Created
March 31, 2016 09:25
-
-
Save bordeo/f9bcb344510714c4c6e30fd140e4ae84 to your computer and use it in GitHub Desktop.
Bootstrap and Prototype Conflicts Workaround - http://www.softec.lu/site/DevelopersCorner/BootstrapPrototypeConflict
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
jQuery.noConflict() | |
if Prototype.BrowserFeatures.ElementExtensions | |
disablePrototypeJS = (method, pluginsToDisable) -> | |
handler = (event) -> | |
event.target[method] = undefined | |
setTimeout -> | |
delete event.target[method] | |
return | |
, 0 | |
return | |
pluginsToDisable.each (plugin) -> | |
jQuery(window).on method + '.bs.' + plugin, handler | |
return | |
return | |
pluginsToDisable = [ | |
'collapse' | |
'dropdown' | |
'modal' | |
'tooltip' | |
'popover' | |
'tab' | |
] | |
disablePrototypeJS 'show', pluginsToDisable | |
disablePrototypeJS 'hide', pluginsToDisable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment