add Lists.select() and make filter dialogs use it
This commit is contained in:
parent
40204618bf
commit
0e25f5d512
|
@ -282,24 +282,10 @@ define(["dojo/_base/declare"], function (declare) {
|
|||
Filters.editFilterTest(query);
|
||||
},
|
||||
selectRules: function (select) {
|
||||
$$("#filterDlg_Matches input[type=checkbox]").each(function (e) {
|
||||
e.checked = select;
|
||||
if (select)
|
||||
e.parentNode.addClassName("Selected");
|
||||
else
|
||||
e.parentNode.removeClassName("Selected");
|
||||
});
|
||||
Lists.select("filterDlg_Matches", select);
|
||||
},
|
||||
selectActions: function (select) {
|
||||
$$("#filterDlg_Actions input[type=checkbox]").each(function (e) {
|
||||
e.checked = select;
|
||||
|
||||
if (select)
|
||||
e.parentNode.addClassName("Selected");
|
||||
else
|
||||
e.parentNode.removeClassName("Selected");
|
||||
|
||||
});
|
||||
Lists.select("filterDlg_Actions", select);
|
||||
},
|
||||
editRule: function (e) {
|
||||
const li = e.parentNode;
|
||||
|
|
|
@ -153,24 +153,10 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
|
|||
Filters.editFilterTest(query);
|
||||
},
|
||||
selectRules: function (select) {
|
||||
$$("#filterDlg_Matches input[type=checkbox]").each(function (e) {
|
||||
e.checked = select;
|
||||
if (select)
|
||||
e.parentNode.addClassName("Selected");
|
||||
else
|
||||
e.parentNode.removeClassName("Selected");
|
||||
});
|
||||
Lists.select("filterDlg_Matches", select);
|
||||
},
|
||||
selectActions: function (select) {
|
||||
$$("#filterDlg_Actions input[type=checkbox]").each(function (e) {
|
||||
e.checked = select;
|
||||
|
||||
if (select)
|
||||
e.parentNode.addClassName("Selected");
|
||||
else
|
||||
e.parentNode.removeClassName("Selected");
|
||||
|
||||
});
|
||||
Lists.select("filterDlg_Actions", select);
|
||||
},
|
||||
editRule: function (e) {
|
||||
const li = e.parentNode;
|
||||
|
|
18
js/common.js
18
js/common.js
|
@ -56,7 +56,23 @@ const Lists = {
|
|||
|
||||
if (row)
|
||||
checked ? row.addClassName("Selected") : row.removeClassName("Selected");
|
||||
}
|
||||
},
|
||||
select: function(elemId, selected) {
|
||||
$(elemId).select("li").each((row) => {
|
||||
const checkNode = row.select(".dijitCheckBox,input[type=checkbox]")[0];
|
||||
if (checkNode) {
|
||||
const widget = dijit.getEnclosingWidget(checkNode);
|
||||
|
||||
if (widget) {
|
||||
widget.attr("checked", selected);
|
||||
} else {
|
||||
checkNode.checked = selected;
|
||||
}
|
||||
|
||||
this.onRowChecked(widget);
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
|
|
Loading…
Reference in New Issue