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/modal.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/modal.js')
| -rw-r--r-- | js/modal.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/js/modal.js b/js/modal.js index cbca61eed..ae1b8e598 100644 --- a/js/modal.js +++ b/js/modal.js @@ -228,9 +228,7 @@ // MODAL PLUGIN DEFINITION // ======================= - var old = $.fn.modal - - $.fn.modal = function (option, _relatedTarget) { + function Plugin(option, _relatedTarget) { return this.each(function () { var $this = $(this) var data = $this.data('bs.modal') @@ -242,6 +240,9 @@ }) } + var old = $.fn.modal + + $.fn.modal = Plugin $.fn.modal.Constructor = Modal @@ -265,11 +266,10 @@ if ($this.is('a')) e.preventDefault() - $target - .modal(option, this) - .one('hide', function () { - $this.is(':visible') && $this.trigger('focus') - }) + Plugin.call($target, option, this) + $target.one('hide', function () { + $this.is(':visible') && $this.trigger('focus') + }) }) }(jQuery); |
