Commit dc4e80a6 authored by fat's avatar fat
Browse files

fix ghetto ass timeout shit

parent 5bd8cdca
Showing with 43 additions and 7 deletions
+43 -7
...@@ -172,6 +172,7 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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()
}
} }
......
This diff is collapsed.
...@@ -172,6 +172,7 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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()
}
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment