diff options
| author | fat <[email protected]> | 2012-12-19 21:55:23 -0800 |
|---|---|---|
| committer | fat <[email protected]> | 2012-12-19 21:55:23 -0800 |
| commit | dc4e80a655509dc1f68d45c950174e79da2f7f08 (patch) | |
| tree | dc08ea4d1536627939cb0a3f4740c24b98fb27db /docs/assets/js/bootstrap.js | |
| parent | 5bd8cdca91615dfb502131c276bfc6d8457c5f79 (diff) | |
| download | bootstrap-dc4e80a655509dc1f68d45c950174e79da2f7f08.tar.xz bootstrap-dc4e80a655509dc1f68d45c950174e79da2f7f08.zip | |
fix ghetto ass timeout shit
Diffstat (limited to 'docs/assets/js/bootstrap.js')
| -rw-r--r-- | docs/assets/js/bootstrap.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/docs/assets/js/bootstrap.js b/docs/assets/js/bootstrap.js index 372eaa97b..1c104a49d 100644 --- a/docs/assets/js/bootstrap.js +++ b/docs/assets/js/bootstrap.js @@ -1889,6 +1889,7 @@ , listen: function () { this.$element + .on('focus', $.proxy(this.focus, this)) .on('blur', $.proxy(this.blur, this)) .on('keypress', $.proxy(this.keypress, this)) .on('keyup', $.proxy(this.keyup, this)) @@ -1900,6 +1901,7 @@ this.$menu .on('click', $.proxy(this.click, this)) .on('mouseenter', 'li', $.proxy(this.mouseenter, this)) + .on('mouseleave', 'li', $.proxy(this.mouseleave, this)) } , eventSupported: function(eventName) { @@ -1973,9 +1975,13 @@ e.preventDefault() } + , focus: function (e) { + this.focused = true + } + , blur: function (e) { - var that = this - setTimeout(function () { that.hide() }, 150) + this.focused = false + if (!this.mousedover && this.shown) this.hide() } , click: function (e) { @@ -1985,10 +1991,16 @@ } , mouseenter: function (e) { + this.mousedover = true this.$menu.find('.active').removeClass('active') $(e.currentTarget).addClass('active') } + , mouseleave: function (e) { + this.mousedover = false + if (!this.focused && this.shown) this.hide() + } + } |
