Skip to content

Commit

Permalink
Merge pull request #91 from bassjobsen/revert-88-master
Browse files Browse the repository at this point in the history
Revert "Syntax fixes and minification without missing `afterSelect`"
  • Loading branch information
bassjobsen committed Dec 2, 2014
2 parents 835da58 + 6a1fa63 commit f7b095a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions bootstrap3-typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
this.shown = false;
this.listen();
this.showHintOnFocus = typeof this.options.showHintOnFocus == 'boolean' ? this.options.showHintOnFocus : false;
this.afterSelect = this.options.afterSelect;
this.afterSelect = this.options.afterSelect
};

Typeahead.prototype = {
Expand Down Expand Up @@ -132,10 +132,10 @@
if (items) {
this.process(items);
}
}, this);
}, this)

clearTimeout(this.lookupWorker);
this.lookupWorker = setTimeout(worker, this.delay);
clearTimeout(this.lookupWorker)
this.lookupWorker = setTimeout(worker, this.delay)
}

, process: function (items) {
Expand All @@ -159,7 +159,7 @@
}

, matcher: function (item) {
return item.toLowerCase().indexOf(this.query.toLowerCase());
return ~item.toLowerCase().indexOf(this.query.toLowerCase());
}

, sorter: function (items) {
Expand All @@ -170,7 +170,7 @@

while ((item = items.shift())) {
if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item);
else if (item.indexOf(this.query)) caseSensitive.push(item);
else if (~item.indexOf(this.query)) caseSensitive.push(item);
else caseInsensitive.push(item);
}

Expand All @@ -183,7 +183,7 @@
var i = item.toLowerCase().indexOf(query.toLowerCase());
var len, leftPart, middlePart, rightPart, strong;
len = query.length;
if(len === 0){
if(len == 0){
return html.text(item).html();
}
while (i > -1) {
Expand Down Expand Up @@ -306,7 +306,7 @@
}

, keydown: function (e) {
this.suppressKeyPressRepeat = $.inArray(e.keyCode, [40,38,9,13,27]);
this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27]);
if (!this.shown && e.keyCode == 40) {
this.lookup("");
} else {
Expand Down
2 changes: 1 addition & 1 deletion bootstrap3-typeahead.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f7b095a

Please sign in to comment.