Index: branches/5.2.x/core/admin_templates/js/grid_filters.js =================================================================== --- branches/5.2.x/core/admin_templates/js/grid_filters.js (revision 16550) +++ branches/5.2.x/core/admin_templates/js/grid_filters.js (revision 16551) @@ -1,153 +1,153 @@ /* Class used to convert element $select.hide(); // create div with checkboxes and buttons var $cur_index = MultiOptions.Selectors.length; var $div = $('
'); MultiOptions.Selectors.push($id); // set defaults for missing phrases if (!phrases['la_btn_SelectAll']) phrases['la_SelectAll'] = 'Select All'; if (!phrases['la_btn_OpenMultiFilter']) phrases['la_OpenMultiFilter'] = 'Open Filter'; if (!phrases['la_btn_Search']) phrases['la_ToolTip_Search'] = 'Search'; if (!phrases['la_btn_Close']) phrases['la_tooltip_close'] = 'Close'; // create div with checkboxes var $options_div = $('
'); // add "Select All" checkbox $options_div.append( '\
' ); var $options = $('option', $select); // add each \
' ); } ); // add buttons to search or close filter $div .append($options_div) .append( '
\  \ \
' ); $('#' + jq($form_name)).append($div); // set click handlers $('#_mutlioptions_cb_' + $cur_index + '_all') .click( function ($e) { MultiOptions.SelectAll($cur_index); } ) - .prop('checked', $options.length == $options.filter(':selected').length > 0); + .prop('checked', $options.length == $options.filter(':selected').length); $('input._mutlioptions_cb_' + $cur_index).click( function ($e) { MultiOptions.ItemChecked($cur_index); } ); // add filter placeholder, used for filter opening filter var $filter = $('
' + phrases['la_OpenMultiFilter'] + '
'); if ($select.hasClass('filter-active')) { $filter.addClass('filter-active'); } $filter .click( function($e) { var $offset = $(this).offset(); var $box_left = $offset.left; $('#' + jq($id) + '_div').css( {left: 0, top: $offset.top} ).show(); var $box_width = $('#' + jq($id) + '_div').outerWidth(); if ($box_left + $box_width > document.body.offsetWidth) { // move left $box_left -= $box_width; } $('#' + jq($id) + '_div').css('left', $box_left); } ) .insertAfter($select); } MultiOptions.CloseSelector = function(selector_index) { $('#' + jq(MultiOptions.Selectors[selector_index]) + '_div').hide(); } MultiOptions.ItemChecked = function(selector_index) { // sync hidden field var $reg_exp = new RegExp('^_mutlioptions_cb_' + selector_index + '_(?!all)([0-9A-Za-z-]+)'); update_checkbox_options($reg_exp, MultiOptions.Selectors[selector_index]); // update "Select All" checkbox var $select_all = $('#_mutlioptions_cb_' + selector_index + '_all'); var $options = $("input[type='checkbox']", '#' + jq(MultiOptions.Selectors[selector_index]) + '_div').not($select_all); - $select_all.prop('checked', $options.length == $options.filter(':checked').length > 0); + $select_all.prop('checked', $options.length == $options.filter(':checked').length); } MultiOptions.SelectAll = function(selector_index) { // set all checkbox to match "Select All" checkbox var $select_all = $('#_mutlioptions_cb_' + selector_index + '_all'); var $checked = $select_all.prop('checked'); $("input[type='checkbox']", '#' + jq(MultiOptions.Selectors[selector_index]) + '_div').not($select_all).prop('checked', $checked); // sync hidden field var $reg_exp = new RegExp('^_mutlioptions_cb_' + selector_index + '_(?!all)([0-9A-Za-z-]+)'); update_checkbox_options($reg_exp, MultiOptions.Selectors[selector_index]); }