Multiselect filtered revomed all/common modules select and added switch

This commit is contained in:
Calvo 2022-02-16 12:26:22 +01:00
parent 9d4eda381b
commit a642f88364
3 changed files with 7 additions and 14 deletions

View File

@ -1575,12 +1575,13 @@ function html_print_select_multiple_modules_filtered(array $data):string
1 => __('Show all modules'), 1 => __('Show all modules'),
]; ];
if (empty($data['commonModulesSwitch']) === false && $data['commonModulesSwitch'] === true) { if (true) {
$output .= html_print_input( $output .= html_print_input(
[ [
'label' => __('Common/all modules'), 'label' => __('Only common modules'),
'type' => 'switch', 'type' => 'switch',
'value' => 'checked',
'id' => 'filtered-module-show-common-modules-'.$uniqId, 'id' => 'filtered-module-show-common-modules-'.$uniqId,
'return' => true, 'return' => true,
'onchange' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')', 'onchange' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',

View File

@ -218,17 +218,9 @@ function fmModuleChange(uniqId, isMeta) {
"#filtered-module-show-common-modules-" + uniqId "#filtered-module-show-common-modules-" + uniqId
).attr("type"); ).attr("type");
var showCommonModules = 0; var showCommonModules = +(
$("#filtered-module-show-common-modules-" + uniqId).prop("checked") == false
if (commonSelectorType != "checkbox") { );
showCommonModules = $(
"#filtered-module-show-common-modules-" + uniqId
).val();
} else {
showCommonModules = +$(
"#filtered-module-show-common-modules-" + uniqId
).prop("checked");
}
jQuery.post( jQuery.post(
"ajax.php", "ajax.php",

View File

@ -392,7 +392,7 @@ function initialiceLayout(data) {
widgetId == 14 || widgetId == 2 || widgetId == 23 || widgetId == 16 widgetId == 14 || widgetId == 2 || widgetId == 23 || widgetId == 16
? 750 ? 750
: 450, : 450,
maxHeight: 610, maxHeight: 650,
minHeight: widgetId == 16 ? 450 : 400 minHeight: widgetId == 16 ? 450 : 400
}, },
onsubmit: { onsubmit: {