Last active
April 30, 2019 13:30
-
-
Save AndresInSpace/9cdd844a57ba79f597337af92edb3e66 to your computer and use it in GitHub Desktop.
Fix Prototype JS Library conflicts with Bootstrap JS (with BS dependent on jQuery)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//ADD THIS TO END OF YOUR JQUERY FILE OR RUN IT AFTER JQUERY IS LOADED | |
// Prototype.js loads -> then jquery.js loads -> then run this | |
//alternatively, upgrade and load jquery 3 first then prototype.js and you shouldn't need this fix. | |
if(Prototype.BrowserFeatures.ElementExtensions){var disablePrototypeJS=function(o,e){var t=function(e){e.target[o]=void 0,setTimeout(function(){delete e.target[o]},0)};e.each(function(e){jQuery(window).on(o+".bs."+e,t)})},pluginsToDisable=["collapse","dropdown","modal","tooltip","popover"];disablePrototypeJS("show",pluginsToDisable),disablePrototypeJS("hide",pluginsToDisable)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment