mirror of https://github.com/twbs/bootstrap.git
check affix pos on clicks - use timeout for clicks which scroll
This commit is contained in:
parent
aec8b08930
commit
0540b63ab0
|
@ -28,7 +28,9 @@
|
||||||
|
|
||||||
var Affix = function (element, options) {
|
var Affix = function (element, options) {
|
||||||
this.options = $.extend({}, $.fn.affix.defaults, options)
|
this.options = $.extend({}, $.fn.affix.defaults, options)
|
||||||
this.$window = $(window).on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
|
this.$window = $(window)
|
||||||
|
.on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
|
||||||
|
.on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
|
||||||
this.$element = $(element)
|
this.$element = $(element)
|
||||||
this.checkPosition()
|
this.checkPosition()
|
||||||
}
|
}
|
||||||
|
|
|
@ -1955,7 +1955,9 @@
|
||||||
|
|
||||||
var Affix = function (element, options) {
|
var Affix = function (element, options) {
|
||||||
this.options = $.extend({}, $.fn.affix.defaults, options)
|
this.options = $.extend({}, $.fn.affix.defaults, options)
|
||||||
this.$window = $(window).on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
|
this.$window = $(window)
|
||||||
|
.on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
|
||||||
|
.on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
|
||||||
this.$element = $(element)
|
this.$element = $(element)
|
||||||
this.checkPosition()
|
this.checkPosition()
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -28,7 +28,9 @@
|
||||||
|
|
||||||
var Affix = function (element, options) {
|
var Affix = function (element, options) {
|
||||||
this.options = $.extend({}, $.fn.affix.defaults, options)
|
this.options = $.extend({}, $.fn.affix.defaults, options)
|
||||||
this.$window = $(window).on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
|
this.$window = $(window)
|
||||||
|
.on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
|
||||||
|
.on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
|
||||||
this.$element = $(element)
|
this.$element = $(element)
|
||||||
this.checkPosition()
|
this.checkPosition()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue