]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
correct event naming of `scroll` and `load' event
authorTobias Lindig <tl@cm4all.com>
Wed, 22 Jan 2014 13:09:41 +0000 (14:09 +0100)
committerChris Rebert <code@rebertia.com>
Mon, 17 Mar 2014 02:58:12 +0000 (19:58 -0700)
closes #12337

dist/js/bootstrap.js
js/scrollspy.js

index bf6a6a202fbde17c50545a64e623c0d24a7e647f..5a130ff02e4fb798ba56d3b8e058ca20117a4a22 100644 (file)
@@ -1578,7 +1578,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
 
     this.$element       = $(element).is('body') ? $(window) : $(element)
     this.$body          = $('body')
-    this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
+    this.$scrollElement = this.$element.on('scroll.bs.scrollspy', process)
     this.options        = $.extend({}, ScrollSpy.DEFAULTS, options)
     this.selector       = (this.options.target
       || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
@@ -1702,7 +1702,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
   // SCROLLSPY DATA-API
   // ==================
 
-  $(window).on('load', function () {
+  $(window).on('load.bs.scrollspy.data-api', function () {
     $('[data-spy="scroll"]').each(function () {
       var $spy = $(this)
       $spy.scrollspy($spy.data())
index fc907f11b26ca267847efd6d3ce6561de94eab67..137bd373fc964549568a6e5e7daaeca7a88ab676 100644 (file)
@@ -19,7 +19,7 @@
 
     this.$element       = $(element).is('body') ? $(window) : $(element)
     this.$body          = $('body')
-    this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
+    this.$scrollElement = this.$element.on('scroll.bs.scrollspy', process)
     this.options        = $.extend({}, ScrollSpy.DEFAULTS, options)
     this.selector       = (this.options.target
       || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
   // SCROLLSPY DATA-API
   // ==================
 
-  $(window).on('load', function () {
+  $(window).on('load.bs.scrollspy.data-api', function () {
     $('[data-spy="scroll"]').each(function () {
       var $spy = $(this)
       $spy.scrollspy($spy.data())