mirror of https://github.com/twbs/bootstrap.git
fix ghetto ass timeout shit
This commit is contained in:
parent
5bd8cdca91
commit
dc4e80a655
|
@ -172,6 +172,7 @@
|
||||||
|
|
||||||
, listen: function () {
|
, listen: function () {
|
||||||
this.$element
|
this.$element
|
||||||
|
.on('focus', $.proxy(this.focus, this))
|
||||||
.on('blur', $.proxy(this.blur, this))
|
.on('blur', $.proxy(this.blur, this))
|
||||||
.on('keypress', $.proxy(this.keypress, this))
|
.on('keypress', $.proxy(this.keypress, this))
|
||||||
.on('keyup', $.proxy(this.keyup, this))
|
.on('keyup', $.proxy(this.keyup, this))
|
||||||
|
@ -183,6 +184,7 @@
|
||||||
this.$menu
|
this.$menu
|
||||||
.on('click', $.proxy(this.click, this))
|
.on('click', $.proxy(this.click, this))
|
||||||
.on('mouseenter', 'li', $.proxy(this.mouseenter, this))
|
.on('mouseenter', 'li', $.proxy(this.mouseenter, this))
|
||||||
|
.on('mouseleave', 'li', $.proxy(this.mouseleave, this))
|
||||||
}
|
}
|
||||||
|
|
||||||
, eventSupported: function(eventName) {
|
, eventSupported: function(eventName) {
|
||||||
|
@ -256,9 +258,13 @@
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
, focus: function (e) {
|
||||||
|
this.focused = true
|
||||||
|
}
|
||||||
|
|
||||||
, blur: function (e) {
|
, blur: function (e) {
|
||||||
var that = this
|
this.focused = false
|
||||||
setTimeout(function () { that.hide() }, 150)
|
if (!this.mousedover && this.shown) this.hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
, click: function (e) {
|
, click: function (e) {
|
||||||
|
@ -268,10 +274,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
, mouseenter: function (e) {
|
, mouseenter: function (e) {
|
||||||
|
this.mousedover = true
|
||||||
this.$menu.find('.active').removeClass('active')
|
this.$menu.find('.active').removeClass('active')
|
||||||
$(e.currentTarget).addClass('active')
|
$(e.currentTarget).addClass('active')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
, mouseleave: function (e) {
|
||||||
|
this.mousedover = false
|
||||||
|
if (!this.focused && this.shown) this.hide()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1889,6 +1889,7 @@
|
||||||
|
|
||||||
, listen: function () {
|
, listen: function () {
|
||||||
this.$element
|
this.$element
|
||||||
|
.on('focus', $.proxy(this.focus, this))
|
||||||
.on('blur', $.proxy(this.blur, this))
|
.on('blur', $.proxy(this.blur, this))
|
||||||
.on('keypress', $.proxy(this.keypress, this))
|
.on('keypress', $.proxy(this.keypress, this))
|
||||||
.on('keyup', $.proxy(this.keyup, this))
|
.on('keyup', $.proxy(this.keyup, this))
|
||||||
|
@ -1900,6 +1901,7 @@
|
||||||
this.$menu
|
this.$menu
|
||||||
.on('click', $.proxy(this.click, this))
|
.on('click', $.proxy(this.click, this))
|
||||||
.on('mouseenter', 'li', $.proxy(this.mouseenter, this))
|
.on('mouseenter', 'li', $.proxy(this.mouseenter, this))
|
||||||
|
.on('mouseleave', 'li', $.proxy(this.mouseleave, this))
|
||||||
}
|
}
|
||||||
|
|
||||||
, eventSupported: function(eventName) {
|
, eventSupported: function(eventName) {
|
||||||
|
@ -1973,9 +1975,13 @@
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
, focus: function (e) {
|
||||||
|
this.focused = true
|
||||||
|
}
|
||||||
|
|
||||||
, blur: function (e) {
|
, blur: function (e) {
|
||||||
var that = this
|
this.focused = false
|
||||||
setTimeout(function () { that.hide() }, 150)
|
if (!this.mousedover && this.shown) this.hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
, click: function (e) {
|
, click: function (e) {
|
||||||
|
@ -1985,10 +1991,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
, mouseenter: function (e) {
|
, mouseenter: function (e) {
|
||||||
|
this.mousedover = true
|
||||||
this.$menu.find('.active').removeClass('active')
|
this.$menu.find('.active').removeClass('active')
|
||||||
$(e.currentTarget).addClass('active')
|
$(e.currentTarget).addClass('active')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
, mouseleave: function (e) {
|
||||||
|
this.mousedover = false
|
||||||
|
if (!this.focused && this.shown) this.hide()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -172,6 +172,7 @@
|
||||||
|
|
||||||
, listen: function () {
|
, listen: function () {
|
||||||
this.$element
|
this.$element
|
||||||
|
.on('focus', $.proxy(this.focus, this))
|
||||||
.on('blur', $.proxy(this.blur, this))
|
.on('blur', $.proxy(this.blur, this))
|
||||||
.on('keypress', $.proxy(this.keypress, this))
|
.on('keypress', $.proxy(this.keypress, this))
|
||||||
.on('keyup', $.proxy(this.keyup, this))
|
.on('keyup', $.proxy(this.keyup, this))
|
||||||
|
@ -183,6 +184,7 @@
|
||||||
this.$menu
|
this.$menu
|
||||||
.on('click', $.proxy(this.click, this))
|
.on('click', $.proxy(this.click, this))
|
||||||
.on('mouseenter', 'li', $.proxy(this.mouseenter, this))
|
.on('mouseenter', 'li', $.proxy(this.mouseenter, this))
|
||||||
|
.on('mouseleave', 'li', $.proxy(this.mouseleave, this))
|
||||||
}
|
}
|
||||||
|
|
||||||
, eventSupported: function(eventName) {
|
, eventSupported: function(eventName) {
|
||||||
|
@ -256,9 +258,13 @@
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
, focus: function (e) {
|
||||||
|
this.focused = true
|
||||||
|
}
|
||||||
|
|
||||||
, blur: function (e) {
|
, blur: function (e) {
|
||||||
var that = this
|
this.focused = false
|
||||||
setTimeout(function () { that.hide() }, 150)
|
if (!this.mousedover && this.shown) this.hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
, click: function (e) {
|
, click: function (e) {
|
||||||
|
@ -268,10 +274,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
, mouseenter: function (e) {
|
, mouseenter: function (e) {
|
||||||
|
this.mousedover = true
|
||||||
this.$menu.find('.active').removeClass('active')
|
this.$menu.find('.active').removeClass('active')
|
||||||
$(e.currentTarget).addClass('active')
|
$(e.currentTarget).addClass('active')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
, mouseleave: function (e) {
|
||||||
|
this.mousedover = false
|
||||||
|
if (!this.focused && this.shown) this.hide()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue