Skip to content

Instantly share code, notes, and snippets.

@AndresInSpace
Last active April 30, 2019 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndresInSpace/9cdd844a57ba79f597337af92edb3e66 to your computer and use it in GitHub Desktop.
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)
//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