-
-
Notifications
You must be signed in to change notification settings - Fork 150
customButtons set by plugins are being overwritten #499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I need to think about some kind of universal approach here, because you need |
Thank you for your response. My plugin is quite simple — it just toggles fullscreen mode. Here is the relevant code: const Fullscreen = {
createOptions(options) {
options.customButtons['fullscreen'] = {
text: 'FS',
click: (e) => {
if (document.fullscreenElement) {
document.exitFullscreen();
} else {
e.target.closest('.ec').requestFullscreen();
}
},
};
},
}; When the user does not define However, if a user defines their own const ec = createCalendar(
document.getElementById('ec'),
[DayGrid, Fullscreen],
{
headerToolbar: { start: 'prev,next today', center: 'title', end: 'dayGridMonth myButton fullscreen' },
customButtons: {
myButton: { text: 'My Button', click: () => {} },
},
...
}
); |
Thank you for sharing your code. I'll try to come up with a solution. |
In the plugin I am currently developing, I add
customButtons
with custom functionality, and they are working as intended.However, when users define their own
customButtons
, it seems that all previously defined custom buttons are overwritten by the user’s settings.Would it be possible to change this behavior so that the plugin-defined
customButtons
and the user-defined customButtons are merged instead of replaced?The text was updated successfully, but these errors were encountered: