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/scrollspy.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/scrollspy.js')
| -rw-r--r-- | js/scrollspy.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/js/scrollspy.js b/js/scrollspy.js index c77a9fbed..1f9153552 100644 --- a/js/scrollspy.js +++ b/js/scrollspy.js @@ -116,9 +116,7 @@ // SCROLLSPY PLUGIN DEFINITION // =========================== - var old = $.fn.scrollspy - - $.fn.scrollspy = function (option) { + function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.scrollspy') @@ -129,6 +127,9 @@ }) } + var old = $.fn.scrollspy + + $.fn.scrollspy = Plugin $.fn.scrollspy.Constructor = ScrollSpy @@ -147,7 +148,7 @@ $(window).on('load.bs.scrollspy.data-api', function () { $('[data-spy="scroll"]').each(function () { var $spy = $(this) - $spy.scrollspy($spy.data()) + Plugin.call($spy, $spy.data()) }) }) |
