🌐 AI搜索 & 代理 主页
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
- secure: VY4J2ERfrMEin++f4+UDDtTMWLuE3jaYAVchRxfO2c6PQUYgR+SW4SMekz855U/BuptMtiVMR2UUoNGMgOSKIFkIXpPfHhx47G5a541v0WNjXfQ2qzivXAWaXNK3l3C58z4dKxgPWsFY9JtMVCddJd2vQieAILto8D8G09p7bpo=
- secure: kehbNCoYUG2gLnhmCH/oKhlJG6LoxgcOPMCtY7KOI4ropG8qlypb+O2b/19+BWeO3aIuMB0JajNh3p2NL0UKgLmUK7EYBA9fQz+vesFReRk0V/KqMTSxHJuseM4aLOWA2Wr9US843VGltfODVvDN5sNrfY7RcoRx2cTK/k1CXa8=
node_js:
- "4.1"
- "10.18.0"
cache:
directories:
- node_modules
Expand Down
22 changes: 17 additions & 5 deletions dist/typeahead.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -1430,19 +1430,25 @@
40: "down"
};
function Input(o, www) {
var id;
o = o || {};
if (!o.input) {
$.error("input is missing");
}
www.mixin(this);
this.$hint = $(o.hint);
this.$input = $(o.input);
this.$menu = $(o.menu);
id = this.$input.attr("id") || _.guid();
this.$menu.attr("id", id + "_listbox");
this.$hint.attr({
"aria-hidden": true
});
this.$input.attr({
"aria-activedescendant": "",
"aria-owns": this.$input.attr("id") + "_listbox",
"aria-owns": id + "_listbox",
role: "combobox",
"aria-readonly": "true",
"aria-autocomplete": "list"
"aria-autocomplete": "list",
"aria-expanded": false
});
$(www.menu).attr("id", this.$input.attr("id") + "_listbox");
this.query = this.$input.val();
Expand Down Expand Up @@ -1617,6 +1623,9 @@
this.$input.off(".tt");
this.$overflowHelper.remove();
this.$hint = this.$input = this.$overflowHelper = $("<div>");
},
setAriaExpanded: function setAriaExpanded(value) {
this.$input.attr("aria-expanded", value);
}
});
return Input;
Expand Down Expand Up @@ -2307,6 +2316,7 @@
},
open: function open() {
if (!this.isOpen() && !this.eventBus.before("open")) {
this.input.setAriaExpanded(true);
this.menu.open();
this._updateHint();
this.eventBus.trigger("open");
Expand All @@ -2315,6 +2325,7 @@
},
close: function close() {
if (this.isOpen() && !this.eventBus.before("close")) {
this.input.setAriaExpanded(false);
this.menu.close();
this.input.clearHint();
this.input.resetInputValue();
Expand Down Expand Up @@ -2433,7 +2444,8 @@
});
input = new Input({
hint: $hint,
input: $input
input: $input,
menu: $menu
}, www);
menu = new MenuConstructor({
node: $menu,
Expand Down
4 changes: 2 additions & 2 deletions dist/typeahead.bundle.min.js

Large diffs are not rendered by default.

22 changes: 17 additions & 5 deletions dist/typeahead.jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,19 +483,25 @@
40: "down"
};
function Input(o, www) {
var id;
o = o || {};
if (!o.input) {
$.error("input is missing");
}
www.mixin(this);
this.$hint = $(o.hint);
this.$input = $(o.input);
this.$menu = $(o.menu);
id = this.$input.attr("id") || _.guid();
this.$menu.attr("id", id + "_listbox");
this.$hint.attr({
"aria-hidden": true
});
this.$input.attr({
"aria-activedescendant": "",
"aria-owns": this.$input.attr("id") + "_listbox",
"aria-owns": id + "_listbox",
role: "combobox",
"aria-readonly": "true",
"aria-autocomplete": "list"
"aria-autocomplete": "list",
"aria-expanded": false
});
$(www.menu).attr("id", this.$input.attr("id") + "_listbox");
this.query = this.$input.val();
Expand Down Expand Up @@ -670,6 +676,9 @@
this.$input.off(".tt");
this.$overflowHelper.remove();
this.$hint = this.$input = this.$overflowHelper = $("<div>");
},
setAriaExpanded: function setAriaExpanded(value) {
this.$input.attr("aria-expanded", value);
}
});
return Input;
Expand Down Expand Up @@ -1360,6 +1369,7 @@
},
open: function open() {
if (!this.isOpen() && !this.eventBus.before("open")) {
this.input.setAriaExpanded(true);
this.menu.open();
this._updateHint();
this.eventBus.trigger("open");
Expand All @@ -1368,6 +1378,7 @@
},
close: function close() {
if (this.isOpen() && !this.eventBus.before("close")) {
this.input.setAriaExpanded(false);
this.menu.close();
this.input.clearHint();
this.input.resetInputValue();
Expand Down Expand Up @@ -1486,7 +1497,8 @@
});
input = new Input({
hint: $hint,
input: $input
input: $input,
menu: $menu
}, www);
menu = new MenuConstructor({
node: $menu,
Expand Down
2 changes: 1 addition & 1 deletion dist/typeahead.jquery.min.js

Large diffs are not rendered by default.

Loading