Problem/Motivation
My site's theme code uses particular button and drop-down styling that has its own interaction model and javascript for handling drop-downs. I can prevent the addtocal.css from loading to style the buttons to fit my theme, but there currently isn't a way to prevent the addtocal.js file's menu-toggler javascript from interfering with my theme's javascript without also dropping the ics download javascript code.
Proposed resolution
I propose splitting the module's javascript library into two parts, one for the menu-handling and one for the downloading code. This would allow themes to prevent loading of the menu-handling js while allowing the download code to still operate.
User interface changes
None by default, allows customization.
API changes
Will allow a theme to add a block like this to their info.yml to block the module's CSS & JS if the theme is providing its own:
libraries-override:
addtocal/addtocal:
js:
addtocal.js: false
css:
theme:
addtocal.css: false
Data model changes
None
I have a patch worked up that I'll post in a moment.
Issue fork addtocal-3187762
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3187762-separate-menu-js changes, plain diff MR !2
Comments
Comment #4
wxactly CreditAttribution: wxactly at ThinkShout commentedThanks adamfranco - I split out addtocal-download into a separate file, this will be in the next release.
Comment #6
wxactly CreditAttribution: wxactly at ThinkShout commented