Skip to content

Commit 0f366e0

Browse files
tlindigcvrebert
authored andcommitted
correct event naming of scroll and `load' event
closes twbs#12337
1 parent b7ab799 commit 0f366e0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

dist/js/bootstrap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,7 +1578,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
15781578

15791579
this.$element = $(element).is('body') ? $(window) : $(element)
15801580
this.$body = $('body')
1581-
this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
1581+
this.$scrollElement = this.$element.on('scroll.bs.scrollspy', process)
15821582
this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
15831583
this.selector = (this.options.target
15841584
|| ((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
17021702
// SCROLLSPY DATA-API
17031703
// ==================
17041704

1705-
$(window).on('load', function () {
1705+
$(window).on('load.bs.scrollspy.data-api', function () {
17061706
$('[data-spy="scroll"]').each(function () {
17071707
var $spy = $(this)
17081708
$spy.scrollspy($spy.data())

js/scrollspy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
this.$element = $(element).is('body') ? $(window) : $(element)
2121
this.$body = $('body')
22-
this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
22+
this.$scrollElement = this.$element.on('scroll.bs.scrollspy', process)
2323
this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
2424
this.selector = (this.options.target
2525
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
@@ -143,7 +143,7 @@
143143
// SCROLLSPY DATA-API
144144
// ==================
145145

146-
$(window).on('load', function () {
146+
$(window).on('load.bs.scrollspy.data-api', function () {
147147
$('[data-spy="scroll"]').each(function () {
148148
var $spy = $(this)
149149
$spy.scrollspy($spy.data())

0 commit comments

Comments
 (0)