Fire the selectall event when select all element is clicked.

add_all_options
Patrick Filler 2012-02-28 16:19:01 -05:00
parent 1466f160fc
commit c254bfd02e
6 changed files with 6 additions and 2 deletions

View File

@ -601,6 +601,7 @@ Copyright (c) 2011 by Harvest
if (!option.disabled) option.selected = true; if (!option.disabled) option.selected = true;
} }
this.form_field_jq.trigger("liszt:updated"); this.form_field_jq.trigger("liszt:updated");
this.form_field_jq.trigger("liszt:selectall");
return this.select_all_disable(); return this.select_all_disable();
}; };

File diff suppressed because one or more lines are too long

View File

@ -591,6 +591,7 @@ Copyright (c) 2011 by Harvest
if (!option.disabled) return option.selected = true; if (!option.disabled) return option.selected = true;
}); });
this.form_field.fire("liszt:updated"); this.form_field.fire("liszt:updated");
this.form_field.fire("liszt:selectall");
return this.select_all_disable(); return this.select_all_disable();
}; };

File diff suppressed because one or more lines are too long

View File

@ -265,6 +265,7 @@ class Chosen extends AbstractChosen
for option in options for option in options
option.selected = true if not option.disabled option.selected = true if not option.disabled
@form_field_jq.trigger("liszt:updated") @form_field_jq.trigger("liszt:updated")
@form_field_jq.trigger("liszt:selectall")
this.select_all_disable() this.select_all_disable()
select_all_disable: -> select_all_disable: ->

View File

@ -254,6 +254,7 @@ class Chosen extends AbstractChosen
@form_field.select("option").each (option) -> @form_field.select("option").each (option) ->
option.selected = true if not option.disabled option.selected = true if not option.disabled
@form_field.fire("liszt:updated") @form_field.fire("liszt:updated")
@form_field.fire("liszt:selectall")
this.select_all_disable() this.select_all_disable()
select_all_disable: -> select_all_disable: ->