Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/admin_templates/js/grid_filters.js
Show First 20 Lines • Show All 127 Lines • ▼ Show 20 Line(s) | |||||
} | } | ||||
MultiOptions.CloseSelector = function(selector_index) { | MultiOptions.CloseSelector = function(selector_index) { | ||||
$('#' + jq(MultiOptions.Selectors[selector_index]) + '_div').hide(); | $('#' + jq(MultiOptions.Selectors[selector_index]) + '_div').hide(); | ||||
} | } | ||||
MultiOptions.ItemChecked = function(selector_index) { | MultiOptions.ItemChecked = function(selector_index) { | ||||
// sync hidden field | // sync hidden field | ||||
var $reg_exp = new RegExp('^_mutlioptions_cb_' + selector_index + '_(?!all)([0-9A-Za-z-]+)'); | var $reg_exp = new RegExp('^_mutlioptions_cb_' + selector_index + '_(?!all)([0-9A-Za-z-_]+)'); | ||||
update_checkbox_options($reg_exp, MultiOptions.Selectors[selector_index]); | update_checkbox_options($reg_exp, MultiOptions.Selectors[selector_index]); | ||||
// update "Select All" checkbox | // update "Select All" checkbox | ||||
var $select_all = $('#_mutlioptions_cb_' + selector_index + '_all'); | var $select_all = $('#_mutlioptions_cb_' + selector_index + '_all'); | ||||
var $options = $("input[type='checkbox']", '#' + jq(MultiOptions.Selectors[selector_index]) + '_div').not($select_all); | var $options = $("input[type='checkbox']", '#' + jq(MultiOptions.Selectors[selector_index]) + '_div').not($select_all); | ||||
var $new_checked = $options.length === $options.filter(':checked').length; | var $new_checked = $options.length === $options.filter(':checked').length; | ||||
if ( $select_all.prop('checked') !== $new_checked ) { | if ( $select_all.prop('checked') !== $new_checked ) { | ||||
Show All 10 Lines | |||||
var $checkbox = $(this); | var $checkbox = $(this); | ||||
if ( $checkbox.prop('checked') !== $checked ) { | if ( $checkbox.prop('checked') !== $checked ) { | ||||
$checkbox.prop('checked', $checked).change(); | $checkbox.prop('checked', $checked).change(); | ||||
} | } | ||||
}); | }); | ||||
// sync hidden field | // sync hidden field | ||||
var $reg_exp = new RegExp('^_mutlioptions_cb_' + selector_index + '_(?!all)([0-9A-Za-z-]+)'); | var $reg_exp = new RegExp('^_mutlioptions_cb_' + selector_index + '_(?!all)([0-9A-Za-z-_]+)'); | ||||
update_checkbox_options($reg_exp, MultiOptions.Selectors[selector_index]); | update_checkbox_options($reg_exp, MultiOptions.Selectors[selector_index]); | ||||
} | } |