Fixed disable_search_threshold being ignored when triggering a liszt:updated event
This commit is contained in:
parent
0f89ebef85
commit
17c1e8e18e
|
@ -288,9 +288,6 @@
|
||||||
this.form_field_jq.hide().after(container_div);
|
this.form_field_jq.hide().after(container_div);
|
||||||
this.container = $('#' + this.container_id);
|
this.container = $('#' + this.container_id);
|
||||||
this.container.addClass("chzn-container-" + (this.is_multiple ? "multi" : "single"));
|
this.container.addClass("chzn-container-" + (this.is_multiple ? "multi" : "single"));
|
||||||
if (!this.is_multiple && this.form_field.options.length <= this.disable_search_threshold) {
|
|
||||||
this.container.addClass("chzn-container-single-nosearch");
|
|
||||||
}
|
|
||||||
this.dropdown = this.container.find('div.chzn-drop').first();
|
this.dropdown = this.container.find('div.chzn-drop').first();
|
||||||
dd_top = this.container.height();
|
dd_top = this.container.height();
|
||||||
dd_width = this.f_width - get_side_border_padding(this.dropdown);
|
dd_width = this.f_width - get_side_border_padding(this.dropdown);
|
||||||
|
@ -454,6 +451,11 @@
|
||||||
this.choices = 0;
|
this.choices = 0;
|
||||||
} else if (!this.is_multiple) {
|
} else if (!this.is_multiple) {
|
||||||
this.selected_item.find("span").text(this.default_text);
|
this.selected_item.find("span").text(this.default_text);
|
||||||
|
if (this.form_field.options.length <= this.disable_search_threshold) {
|
||||||
|
this.container.addClass("chzn-container-single-nosearch");
|
||||||
|
} else {
|
||||||
|
this.container.removeClass("chzn-container-single-nosearch");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
content = '';
|
content = '';
|
||||||
_ref = this.results_data;
|
_ref = this.results_data;
|
||||||
|
|
2
chosen/chosen.jquery.min.js
vendored
2
chosen/chosen.jquery.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -282,9 +282,6 @@
|
||||||
});
|
});
|
||||||
this.container = $(this.container_id);
|
this.container = $(this.container_id);
|
||||||
this.container.addClassName("chzn-container-" + (this.is_multiple ? "multi" : "single"));
|
this.container.addClassName("chzn-container-" + (this.is_multiple ? "multi" : "single"));
|
||||||
if (!this.is_multiple && this.form_field.options.length <= this.disable_search_threshold) {
|
|
||||||
this.container.addClassName("chzn-container-single-nosearch");
|
|
||||||
}
|
|
||||||
this.dropdown = this.container.down('div.chzn-drop');
|
this.dropdown = this.container.down('div.chzn-drop');
|
||||||
dd_top = this.container.getHeight();
|
dd_top = this.container.getHeight();
|
||||||
dd_width = this.f_width - get_side_border_padding(this.dropdown);
|
dd_width = this.f_width - get_side_border_padding(this.dropdown);
|
||||||
|
@ -447,6 +444,11 @@
|
||||||
this.choices = 0;
|
this.choices = 0;
|
||||||
} else if (!this.is_multiple) {
|
} else if (!this.is_multiple) {
|
||||||
this.selected_item.down("span").update(this.default_text);
|
this.selected_item.down("span").update(this.default_text);
|
||||||
|
if (this.form_field.options.length <= this.disable_search_threshold) {
|
||||||
|
this.container.addClassName("chzn-container-single-nosearch");
|
||||||
|
} else {
|
||||||
|
this.container.removeClassName("chzn-container-single-nosearch");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
content = '';
|
content = '';
|
||||||
_ref = this.results_data;
|
_ref = this.results_data;
|
||||||
|
|
2
chosen/chosen.proto.min.js
vendored
2
chosen/chosen.proto.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -45,7 +45,6 @@ class Chosen extends AbstractChosen
|
||||||
@form_field_jq.hide().after container_div
|
@form_field_jq.hide().after container_div
|
||||||
@container = ($ '#' + @container_id)
|
@container = ($ '#' + @container_id)
|
||||||
@container.addClass( "chzn-container-" + (if @is_multiple then "multi" else "single") )
|
@container.addClass( "chzn-container-" + (if @is_multiple then "multi" else "single") )
|
||||||
@container.addClass "chzn-container-single-nosearch" if not @is_multiple and @form_field.options.length <= @disable_search_threshold
|
|
||||||
@dropdown = @container.find('div.chzn-drop').first()
|
@dropdown = @container.find('div.chzn-drop').first()
|
||||||
|
|
||||||
dd_top = @container.height()
|
dd_top = @container.height()
|
||||||
|
@ -173,6 +172,10 @@ class Chosen extends AbstractChosen
|
||||||
@choices = 0
|
@choices = 0
|
||||||
else if not @is_multiple
|
else if not @is_multiple
|
||||||
@selected_item.find("span").text @default_text
|
@selected_item.find("span").text @default_text
|
||||||
|
if @form_field.options.length <= @disable_search_threshold
|
||||||
|
@container.addClass "chzn-container-single-nosearch"
|
||||||
|
else
|
||||||
|
@container.removeClass "chzn-container-single-nosearch"
|
||||||
|
|
||||||
content = ''
|
content = ''
|
||||||
for data in @results_data
|
for data in @results_data
|
||||||
|
|
|
@ -38,7 +38,6 @@ class Chosen extends AbstractChosen
|
||||||
@form_field.hide().insert({ after: base_template })
|
@form_field.hide().insert({ after: base_template })
|
||||||
@container = $(@container_id)
|
@container = $(@container_id)
|
||||||
@container.addClassName( "chzn-container-" + (if @is_multiple then "multi" else "single") )
|
@container.addClassName( "chzn-container-" + (if @is_multiple then "multi" else "single") )
|
||||||
@container.addClassName "chzn-container-single-nosearch" if not @is_multiple and @form_field.options.length <= @disable_search_threshold
|
|
||||||
@dropdown = @container.down('div.chzn-drop')
|
@dropdown = @container.down('div.chzn-drop')
|
||||||
|
|
||||||
dd_top = @container.getHeight()
|
dd_top = @container.getHeight()
|
||||||
|
@ -165,6 +164,10 @@ class Chosen extends AbstractChosen
|
||||||
@choices = 0
|
@choices = 0
|
||||||
else if not @is_multiple
|
else if not @is_multiple
|
||||||
@selected_item.down("span").update(@default_text)
|
@selected_item.down("span").update(@default_text)
|
||||||
|
if @form_field.options.length <= @disable_search_threshold
|
||||||
|
@container.addClassName "chzn-container-single-nosearch"
|
||||||
|
else
|
||||||
|
@container.removeClassName "chzn-container-single-nosearch"
|
||||||
|
|
||||||
content = ''
|
content = ''
|
||||||
for data in @results_data
|
for data in @results_data
|
||||||
|
|
Loading…
Reference in a new issue