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'),
];
if (empty($data['commonModulesSwitch']) === false && $data['commonModulesSwitch'] === true) {
if (true) {
$output .= html_print_input(
[
'label' => __('Common/all modules'),
'label' => __('Only common modules'),
'type' => 'switch',
'value' => 'checked',
'id' => 'filtered-module-show-common-modules-'.$uniqId,
'return' => true,
'onchange' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',

View File

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

View File

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