Merge pull request #331 from Ownatik/master

Fixed disable_search_threshold being ignored when triggering a liszt:updated event
This commit is contained in:
Patrick Filler 2011-11-02 09:22:55 -07:00
commit 581f2073b5
6 changed files with 20 additions and 10 deletions

View file

@ -288,9 +288,6 @@
this.form_field_jq.hide().after(container_div);
this.container = $('#' + this.container_id);
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();
dd_top = this.container.height();
dd_width = this.f_width - get_side_border_padding(this.dropdown);
@ -454,6 +451,11 @@
this.choices = 0;
} else if (!this.is_multiple) {
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 = '';
_ref = this.results_data;

File diff suppressed because one or more lines are too long

View file

@ -282,9 +282,6 @@
});
this.container = $(this.container_id);
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');
dd_top = this.container.getHeight();
dd_width = this.f_width - get_side_border_padding(this.dropdown);
@ -447,6 +444,11 @@
this.choices = 0;
} else if (!this.is_multiple) {
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 = '';
_ref = this.results_data;

File diff suppressed because one or more lines are too long

View file

@ -45,7 +45,6 @@ class Chosen extends AbstractChosen
@form_field_jq.hide().after container_div
@container = ($ '#' + @container_id)
@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()
dd_top = @container.height()
@ -173,6 +172,10 @@ class Chosen extends AbstractChosen
@choices = 0
else if not @is_multiple
@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 = ''
for data in @results_data

View file

@ -38,7 +38,6 @@ class Chosen extends AbstractChosen
@form_field.hide().insert({ after: base_template })
@container = $(@container_id)
@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')
dd_top = @container.getHeight()
@ -165,6 +164,10 @@ class Chosen extends AbstractChosen
@choices = 0
else if not @is_multiple
@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 = ''
for data in @results_data