diff options
| author | Collin Donahue-Oponski <[email protected]> | 2014-04-21 23:03:33 -0600 |
|---|---|---|
| committer | Collin Donahue-Oponski <[email protected]> | 2014-04-21 23:03:33 -0600 |
| commit | a9f2b6ce0fb2ac059e30da259f7ae25282803c09 (patch) | |
| tree | 33aa8358b29db57532dbf2d8560649c7e11f2628 /js/collapse.js | |
| parent | 9c4afc577253ada54d3ff27965e380a5c9f4e60e (diff) | |
| download | bootstrap-a9f2b6ce0fb2ac059e30da259f7ae25282803c09.tar.xz bootstrap-a9f2b6ce0fb2ac059e30da259f7ae25282803c09.zip | |
#11464 - Fix JS noConflict mode - Refactor all plugins to use an internal reference to the jQuery plugin, because in noConflict mode you can never expect to be defined on the jQuery object
Diffstat (limited to 'js/collapse.js')
| -rw-r--r-- | js/collapse.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/js/collapse.js b/js/collapse.js index 266f3580d..4347ca5e5 100644 --- a/js/collapse.js +++ b/js/collapse.js @@ -43,7 +43,7 @@ if (actives && actives.length) { var hasData = actives.data('bs.collapse') if (hasData && hasData.transitioning) return - actives.collapse('hide') + Plugin.call(actives, 'hide') hasData || actives.data('bs.collapse', null) } @@ -124,9 +124,7 @@ // COLLAPSE PLUGIN DEFINITION // ========================== - var old = $.fn.collapse - - $.fn.collapse = function (option) { + function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.collapse') @@ -138,6 +136,9 @@ }) } + var old = $.fn.collapse + + $.fn.collapse = Plugin $.fn.collapse.Constructor = Collapse @@ -169,7 +170,7 @@ $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') } - $target.collapse(option) + Plugin.call($target, option) }) }(jQuery); |
