From a9f2b6ce0fb2ac059e30da259f7ae25282803c09 Mon Sep 17 00:00:00 2001 From: Collin Donahue-Oponski Date: Mon, 21 Apr 2014 23:03:33 -0600 Subject: #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 --- js/button.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'js/button.js') 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() }) -- cgit v1.2.3