Skip to content

Commit 6c39988

Browse files
committed
Rebuild dist for latest release.
1 parent bf9419b commit 6c39988

6 files changed

+48
-26
lines changed

dist/bloodhound.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
/*!
2-
* typeahead.js 1.1.1
2+
* typeahead.js 1.2.0
33
* https://github.com/twitter/typeahead.js
44
* Copyright 2013-2017 Twitter, Inc. and other contributors; Licensed MIT
55
*/
66

7-
87
(function(root, factory) {
98
if (typeof define === "function" && define.amd) {
109
define([ "jquery" ], function(a0) {
1110
return root["Bloodhound"] = factory(a0);
1211
});
13-
} else if (typeof module === "object" && module.exports) {
12+
} else if (typeof exports === "object") {
1413
module.exports = factory(require("jquery"));
1514
} else {
1615
root["Bloodhound"] = factory(root["jQuery"]);
@@ -159,7 +158,7 @@
159158
noop: function() {}
160159
};
161160
}();
162-
var VERSION = "1.1.1";
161+
var VERSION = "1.2.0";
163162
var tokenizers = function() {
164163
"use strict";
165164
return {

dist/bloodhound.min.js

+2-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/typeahead.bundle.js

+20-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
/*!
2-
* typeahead.js 1.1.1
2+
* typeahead.js 1.2.0
33
* https://github.com/twitter/typeahead.js
44
* Copyright 2013-2017 Twitter, Inc. and other contributors; Licensed MIT
55
*/
66

7-
87
(function(root, factory) {
98
if (typeof define === "function" && define.amd) {
109
define([ "jquery" ], function(a0) {
1110
return root["Bloodhound"] = factory(a0);
1211
});
13-
} else if (typeof module === "object" && module.exports) {
12+
} else if (typeof exports === "object") {
1413
module.exports = factory(require("jquery"));
1514
} else {
1615
root["Bloodhound"] = factory(root["jQuery"]);
@@ -159,7 +158,7 @@
159158
noop: function() {}
160159
};
161160
}();
162-
var VERSION = "1.1.1";
161+
var VERSION = "1.2.0";
163162
var tokenizers = function() {
164163
"use strict";
165164
return {
@@ -957,7 +956,7 @@
957956
define([ "jquery" ], function(a0) {
958957
return factory(a0);
959958
});
960-
} else if (typeof module === "object" && module.exports) {
959+
} else if (typeof exports === "object") {
961960
module.exports = factory(require("jquery"));
962961
} else {
963962
factory(root["jQuery"]);
@@ -2114,6 +2113,7 @@
21142113
this.input = o.input;
21152114
this.menu = o.menu;
21162115
this.enabled = true;
2116+
this.autoselect = !!o.autoselect;
21172117
this.active = false;
21182118
this.input.hasFocus() && this.activate();
21192119
this.dir = this.input.getLangDir();
@@ -2162,6 +2162,10 @@
21622162
},
21632163
_onDatasetRendered: function onDatasetRendered(type, suggestions, async, dataset) {
21642164
this._updateHint();
2165+
if (this.autoselect) {
2166+
var cursorClass = this.selectors.cursor.substr(1);
2167+
this.menu.$node.find(this.selectors.suggestion).first().addClass(cursorClass);
2168+
}
21652169
this.eventBus.trigger("render", suggestions, async, dataset);
21662170
},
21672171
_onAsyncRequested: function onAsyncRequested(type, dataset, query) {
@@ -2188,6 +2192,11 @@
21882192
$e.preventDefault();
21892193
$e.stopPropagation();
21902194
}
2195+
} else if (this.autoselect) {
2196+
if (this.select(this.menu.getTopSelectable())) {
2197+
$e.preventDefault();
2198+
$e.stopPropagation();
2199+
}
21912200
}
21922201
},
21932202
_onTabKeyed: function onTabKeyed(type, $e) {
@@ -2429,7 +2438,8 @@
24292438
input: input,
24302439
menu: menu,
24312440
eventBus: eventBus,
2432-
minLength: o.minLength
2441+
minLength: o.minLength,
2442+
autoselect: o.autoselect
24332443
}, www);
24342444
$input.data(keys.www, www);
24352445
$input.data(keys.typeahead, typeahead);
@@ -2553,7 +2563,10 @@
25532563
});
25542564
}
25552565
function buildHintFromInput($input, www) {
2556-
return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop("readonly", true).removeAttr("id name placeholder required").attr({
2566+
return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop({
2567+
readonly: true,
2568+
required: false
2569+
}).removeAttr("id name placeholder").removeClass("required").attr({
25572570
spellcheck: "false",
25582571
tabindex: -1
25592572
});

dist/typeahead.bundle.min.js

+3-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/typeahead.jquery.js

+18-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
/*!
2-
* typeahead.js 1.1.1
2+
* typeahead.js 1.2.0
33
* https://github.com/twitter/typeahead.js
44
* Copyright 2013-2017 Twitter, Inc. and other contributors; Licensed MIT
55
*/
66

7-
87
(function(root, factory) {
98
if (typeof define === "function" && define.amd) {
109
define([ "jquery" ], function(a0) {
1110
return factory(a0);
1211
});
13-
} else if (typeof module === "object" && module.exports) {
12+
} else if (typeof exports === "object") {
1413
module.exports = factory(require("jquery"));
1514
} else {
1615
factory(root["jQuery"]);
@@ -1167,6 +1166,7 @@
11671166
this.input = o.input;
11681167
this.menu = o.menu;
11691168
this.enabled = true;
1169+
this.autoselect = !!o.autoselect;
11701170
this.active = false;
11711171
this.input.hasFocus() && this.activate();
11721172
this.dir = this.input.getLangDir();
@@ -1215,6 +1215,10 @@
12151215
},
12161216
_onDatasetRendered: function onDatasetRendered(type, suggestions, async, dataset) {
12171217
this._updateHint();
1218+
if (this.autoselect) {
1219+
var cursorClass = this.selectors.cursor.substr(1);
1220+
this.menu.$node.find(this.selectors.suggestion).first().addClass(cursorClass);
1221+
}
12181222
this.eventBus.trigger("render", suggestions, async, dataset);
12191223
},
12201224
_onAsyncRequested: function onAsyncRequested(type, dataset, query) {
@@ -1241,6 +1245,11 @@
12411245
$e.preventDefault();
12421246
$e.stopPropagation();
12431247
}
1248+
} else if (this.autoselect) {
1249+
if (this.select(this.menu.getTopSelectable())) {
1250+
$e.preventDefault();
1251+
$e.stopPropagation();
1252+
}
12441253
}
12451254
},
12461255
_onTabKeyed: function onTabKeyed(type, $e) {
@@ -1482,7 +1491,8 @@
14821491
input: input,
14831492
menu: menu,
14841493
eventBus: eventBus,
1485-
minLength: o.minLength
1494+
minLength: o.minLength,
1495+
autoselect: o.autoselect
14861496
}, www);
14871497
$input.data(keys.www, www);
14881498
$input.data(keys.typeahead, typeahead);
@@ -1606,7 +1616,10 @@
16061616
});
16071617
}
16081618
function buildHintFromInput($input, www) {
1609-
return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop("readonly", true).removeAttr("id name placeholder required").attr({
1619+
return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop({
1620+
readonly: true,
1621+
required: false
1622+
}).removeAttr("id name placeholder").removeClass("required").attr({
16101623
spellcheck: "false",
16111624
tabindex: -1
16121625
});

dist/typeahead.jquery.min.js

+2-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)