Skip to content

Instantly share code, notes, and snippets.

@andyhausmann
Created May 20, 2014 09:15
Show Gist options
  • Save andyhausmann/56ae58af55b14ecd56df to your computer and use it in GitHub Desktop.
Save andyhausmann/56ae58af55b14ecd56df to your computer and use it in GitHub Desktop.
Twitter Bootstrap and Prototype: How to fix Bootstraps problems.
jQuery(document).ready( function() {
var isBootstrapEvent = false;
if (window.jQuery) {
var all = jQuery('*');
jQuery.each(['hide.bs.dropdown',
'hide.bs.collapse',
'hide.bs.modal',
'hide.bs.tooltip',
'hide.bs.popover'], function(index, eventName) {
all.on(eventName, function( event ) {
isBootstrapEvent = true;
});
});
}
var originalHide = Element.hide;
Element.addMethods({
hide: function(element) {
if(isBootstrapEvent) {
isBootstrapEvent = false;
return element;
}
return originalHide(element);
}
});
});
@kressly
Copy link

kressly commented Apr 29, 2016

Hi thanks a lot for this.
I implemented this and it worked for me for some but not when it is with jquery ui. Kindly check this page

http://usefaith.voiedusucces.net/adminlte/

and click on the left menu and u will see that some of the Icon disappear. I will really appreciate if you can help me out with this. Thanks
1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment