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/button.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/button.js')
| -rw-r--r-- | js/button.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/js/button.js b/js/button.js index be3b769c2..b359a6ec6 100644 --- a/js/button.js +++ b/js/button.js @@ -67,9 +67,7 @@ // BUTTON PLUGIN DEFINITION // ======================== - var old = $.fn.button - - $.fn.button = function (option) { + function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.button') @@ -82,6 +80,9 @@ }) } + var old = $.fn.button + + $.fn.button = Plugin $.fn.button.Constructor = Button @@ -100,7 +101,7 @@ $(document).on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { var $btn = $(e.target) if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') - $btn.button('toggle') + Plugin.call($btn, 'toggle') e.preventDefault() }) |
