From 08b8571cb842e9fc668d9faf6c305a51523b27fb Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Wed, 5 Sep 2012 10:00:57 -0700 Subject: version bump to get this started --- js/bootstrap-typeahead.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/bootstrap-typeahead.js') diff --git a/js/bootstrap-typeahead.js b/js/bootstrap-typeahead.js index c2ccdea21..d079da3a7 100644 --- a/js/bootstrap-typeahead.js +++ b/js/bootstrap-typeahead.js @@ -1,5 +1,5 @@ /* ============================================================= - * bootstrap-typeahead.js v2.1.1 + * bootstrap-typeahead.js v2.1.2 * http://twitter.github.com/bootstrap/javascript.html#typeahead * ============================================================= * Copyright 2012 Twitter, Inc. -- cgit v1.2.3 From 667179f406ea66fbe2d688bb132eaa0c0f7383a6 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Thu, 20 Sep 2012 16:23:54 -0700 Subject: added support for jquery 1.8.* --- js/bootstrap-typeahead.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'js/bootstrap-typeahead.js') diff --git a/js/bootstrap-typeahead.js b/js/bootstrap-typeahead.js index d079da3a7..78cbe9faa 100644 --- a/js/bootstrap-typeahead.js +++ b/js/bootstrap-typeahead.js @@ -174,7 +174,7 @@ .on('keypress', $.proxy(this.keypress, this)) .on('keyup', $.proxy(this.keyup, this)) - if ($.browser.chrome || $.browser.webkit || $.browser.msie) { + if (this.eventSupported('keydown')) { this.$element.on('keydown', $.proxy(this.keydown, this)) } @@ -183,6 +183,15 @@ .on('mouseenter', 'li', $.proxy(this.mouseenter, this)) } + , eventSupported: function(eventName) { + var isSupported = eventName in this.$element + if (!isSupported) { + this.$element.setAttribute(eventName, 'return;') + isSupported = typeof this.$element[eventName] === 'function' + } + return isSupported + } + , move: function (e) { if (!this.shown) return -- cgit v1.2.3 From 474471b83140350de320f3ba940bd7dd8326b32e Mon Sep 17 00:00:00 2001 From: Carl Porth Date: Wed, 26 Sep 2012 23:11:03 -0700 Subject: bind data-api events to document instead of body to allow body replacement --- js/bootstrap-typeahead.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/bootstrap-typeahead.js') diff --git a/js/bootstrap-typeahead.js b/js/bootstrap-typeahead.js index 78cbe9faa..ab1d66879 100644 --- a/js/bootstrap-typeahead.js +++ b/js/bootstrap-typeahead.js @@ -298,7 +298,7 @@ * ================== */ $(function () { - $('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) { + $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) { var $this = $(this) if ($this.data('typeahead')) return e.preventDefault() -- cgit v1.2.3 From e1f6458e3640a628cdb6b2e4c63950777d46e141 Mon Sep 17 00:00:00 2001 From: Carl Porth Date: Thu, 27 Sep 2012 15:00:02 -0700 Subject: don't wait for ready when binding events to document --- js/bootstrap-typeahead.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'js/bootstrap-typeahead.js') diff --git a/js/bootstrap-typeahead.js b/js/bootstrap-typeahead.js index ab1d66879..dc0c7fa07 100644 --- a/js/bootstrap-typeahead.js +++ b/js/bootstrap-typeahead.js @@ -297,13 +297,11 @@ /* TYPEAHEAD DATA-API * ================== */ - $(function () { - $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) { - var $this = $(this) - if ($this.data('typeahead')) return - e.preventDefault() - $this.typeahead($this.data()) - }) + $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) { + var $this = $(this) + if ($this.data('typeahead')) return + e.preventDefault() + $this.typeahead($this.data()) }) }(window.jQuery); -- cgit v1.2.3 From ba2a99e7c440e6dd88bcb33501a7ba790ceec445 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Wed, 17 Oct 2012 23:39:41 -0700 Subject: don't lookup typeahead when shift alt or ctrl are pushed --- js/bootstrap-typeahead.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'js/bootstrap-typeahead.js') diff --git a/js/bootstrap-typeahead.js b/js/bootstrap-typeahead.js index dc0c7fa07..04396411a 100644 --- a/js/bootstrap-typeahead.js +++ b/js/bootstrap-typeahead.js @@ -230,6 +230,9 @@ switch(e.keyCode) { case 40: // down arrow case 38: // up arrow + case 16: // shift + case 17: // ctrl + case 18: // alt break case 9: // tab -- cgit v1.2.3 From 41ad16fe406956cc8604b295ae0b5f185386c595 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 29 Oct 2012 21:00:53 -0700 Subject: v2.2.0 instead of v2.1.2 --- js/bootstrap-typeahead.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/bootstrap-typeahead.js') diff --git a/js/bootstrap-typeahead.js b/js/bootstrap-typeahead.js index 04396411a..3c8416f8c 100644 --- a/js/bootstrap-typeahead.js +++ b/js/bootstrap-typeahead.js @@ -1,5 +1,5 @@ /* ============================================================= - * bootstrap-typeahead.js v2.1.2 + * bootstrap-typeahead.js v2.2.0 * http://twitter.github.com/bootstrap/javascript.html#typeahead * ============================================================= * Copyright 2012 Twitter, Inc. -- cgit v1.2.3