Update chosen library to 1.8.7

This commit is contained in:
Isaac Connor 2018-12-24 09:37:49 -05:00
parent e5a073c8df
commit 0cce0a642b
4 changed files with 33 additions and 17 deletions

View File

@ -2,9 +2,9 @@
Chosen, a Select Box Enhancer for jQuery and Prototype
by Patrick Filler for Harvest, http://getharvest.com
Version 1.8.2
Version 1.8.7
Full source at https://github.com/harvesthq/chosen
Copyright (c) 2011-2017 Harvest http://getharvest.com
Copyright (c) 2011-2018 Harvest http://getharvest.com
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
This file is generated by `grunt build`, do not edit it by hand.
@ -38,10 +38,14 @@ This file is generated by `grunt build`, do not edit it by hand.
-webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
clip: rect(0, 0, 0, 0);
-webkit-clip-path: inset(100% 100%);
clip-path: inset(100% 100%);
}
.chosen-container.chosen-with-drop .chosen-drop {
clip: auto;
-webkit-clip-path: none;
clip-path: none;
}
.chosen-container a {
@ -167,6 +171,8 @@ This file is generated by `grunt build`, do not edit it by hand.
.chosen-container-single.chosen-container-single-nosearch .chosen-search {
position: absolute;
clip: rect(0, 0, 0, 0);
-webkit-clip-path: inset(100% 100%);
clip-path: inset(100% 100%);
}
/* @end */

View File

@ -2,9 +2,9 @@
Chosen, a Select Box Enhancer for jQuery and Prototype
by Patrick Filler for Harvest, http://getharvest.com
Version 1.8.2
Version 1.8.7
Full source at https://github.com/harvesthq/chosen
Copyright (c) 2011-2017 Harvest http://getharvest.com
Copyright (c) 2011-2018 Harvest http://getharvest.com
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
This file is generated by `grunt build`, do not edit it by hand.
@ -161,7 +161,7 @@ This file is generated by `grunt build`, do not edit it by hand.
AbstractChosen.prototype.choice_label = function(item) {
if (this.include_group_label_in_selected && (item.group_label != null)) {
return "<b class='group-name'>" + item.group_label + "</b>" + item.html;
return "<b class='group-name'>" + (this.escape_html(item.group_label)) + "</b>" + item.html;
} else {
return item.html;
}
@ -267,7 +267,9 @@ This file is generated by `grunt build`, do not edit it by hand.
}
option_el = document.createElement("li");
option_el.className = classes.join(" ");
option_el.style.cssText = option.style;
if (option.style) {
option_el.style.cssText = option.style;
}
option_el.setAttribute("data-option-array-index", option.array_index);
option_el.innerHTML = option.highlighted_html || option.html;
if (option.title) {
@ -341,7 +343,7 @@ This file is generated by `grunt build`, do not edit it by hand.
}
};
AbstractChosen.prototype.winnow_results = function() {
AbstractChosen.prototype.winnow_results = function(options) {
var escapedQuery, fix, i, len, option, prefix, query, ref, regex, results, results_group, search_match, startpos, suffix, text;
this.no_results_clear();
results = 0;
@ -397,7 +399,9 @@ This file is generated by `grunt build`, do not edit it by hand.
return this.no_results(query);
} else {
this.update_results_content(this.results_option_build());
return this.winnow_results_set_highlight();
if (!(options != null ? options.skip_highlight : void 0)) {
return this.winnow_results_set_highlight();
}
}
};
@ -540,7 +544,7 @@ This file is generated by `grunt build`, do not edit it by hand.
if (this.options.width != null) {
return this.options.width;
} else {
return this.form_field.offsetWidth + "px";
return this.form_field.offsetWidth+15 + "px";
}
};
@ -941,7 +945,7 @@ This file is generated by `grunt build`, do not edit it by hand.
this.results_data = SelectParser.select_to_array(this.form_field);
if (this.is_multiple) {
this.search_choices.find("li.search-choice").remove();
} else if (!this.is_multiple) {
} else {
this.single_set_selected_text();
if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
this.search_field[0].readOnly = true;
@ -1154,14 +1158,20 @@ This file is generated by `grunt build`, do not edit it by hand.
item.selected = true;
this.form_field.options[item.options_index].selected = true;
this.selected_option_count = null;
this.search_field.val("");
if (this.is_multiple) {
this.choice_build(item);
} else {
this.single_set_selected_text(this.choice_label(item));
}
if (this.is_multiple && (!this.hide_results_on_select || (evt.metaKey || evt.ctrlKey))) {
this.winnow_results();
if (evt.metaKey || evt.ctrlKey) {
this.winnow_results({
skip_highlight: true
});
} else {
this.search_field.val("");
this.winnow_results();
}
} else {
this.results_hide();
this.show_search_field_default();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long