1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-13 17:14:04 +02:00

automatic grunt dist

This commit is contained in:
Bootstrap's Grunt bot
2015-02-25 01:11:20 +00:00
parent 9ea98561df
commit 1d892ceef1
2 changed files with 15 additions and 18 deletions

View File

@@ -1837,10 +1837,8 @@ if (typeof jQuery === 'undefined') {
// ==========================
function ScrollSpy(element, options) {
var process = $.proxy(this.process, this)
this.$body = $('body')
this.$scrollElement = $(element).is('body') ? $(window) : $(element)
this.$body = $(document.body)
this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
this.selector = (this.options.target || '') + ' .nav li > a'
this.offsets = []
@@ -1848,7 +1846,7 @@ if (typeof jQuery === 'undefined') {
this.activeTarget = null
this.scrollHeight = 0
this.$scrollElement.on('scroll.bs.scrollspy', process)
this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
this.refresh()
this.process()
}
@@ -1864,19 +1862,18 @@ if (typeof jQuery === 'undefined') {
}
ScrollSpy.prototype.refresh = function () {
var that = this
var offsetMethod = 'offset'
var offsetBase = 0
if (!$.isWindow(this.$scrollElement[0])) {
offsetMethod = 'position'
offsetBase = this.$scrollElement.scrollTop()
}
this.offsets = []
this.targets = []
this.scrollHeight = this.getScrollHeight()
var self = this
if (!$.isWindow(this.$scrollElement[0])) {
offsetMethod = 'position'
offsetBase = this.$scrollElement.scrollTop()
}
this.$body
.find(this.selector)
@@ -1892,8 +1889,8 @@ if (typeof jQuery === 'undefined') {
})
.sort(function (a, b) { return a[0] - b[0] })
.each(function () {
self.offsets.push(this[0])
self.targets.push(this[1])
that.offsets.push(this[0])
that.targets.push(this[1])
})
}

File diff suppressed because one or more lines are too long