Skip to content

Commit

Permalink
Merge pull request #1245 from phaidon/prototype-bootstrap-patch
Browse files Browse the repository at this point in the history
Prototype-bootstrap compatibility workaround, closes #1190.
  • Loading branch information
Drak committed Sep 28, 2013
2 parents 6c74367 + 079df47 commit 918de88
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/javascript/ajax/original_uncompressed/prototype.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@
*
*--------------------------------------------------------------------------*/

var isBootstrapEvent = false;
if (window.jQuery) {
jQuery('*').on('hide.bs.dropdown', function( event ) {
isBootstrapEvent = true;
});
jQuery('*').on('hide.bs.collapse', function( event ) {
isBootstrapEvent = true;
});
jQuery('*').on('hide.bs.modal', function( event ) {
isBootstrapEvent = true;
});
}

var Prototype = {

Version: '1.7.1',
Expand Down Expand Up @@ -2142,6 +2155,10 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
}

function hide(element) {
if (isBootstrapEvent) {
isBootstrapEvent = false;
return;
}
element = $(element);
element.style.display = 'none';
return element;
Expand Down Expand Up @@ -7033,4 +7050,4 @@ Object.extend(Element.ClassNames.prototype, Enumerable);
return Prototype.Selector.select(selector, element || document);
}
});
})();
})();

0 comments on commit 918de88

Please sign in to comment.