mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 20:15:55 +00:00
add Lists.select() and make filter dialogs use it
This commit is contained in:
@@ -282,24 +282,10 @@ define(["dojo/_base/declare"], function (declare) {
|
|||||||
Filters.editFilterTest(query);
|
Filters.editFilterTest(query);
|
||||||
},
|
},
|
||||||
selectRules: function (select) {
|
selectRules: function (select) {
|
||||||
$$("#filterDlg_Matches input[type=checkbox]").each(function (e) {
|
Lists.select("filterDlg_Matches", select);
|
||||||
e.checked = select;
|
|
||||||
if (select)
|
|
||||||
e.parentNode.addClassName("Selected");
|
|
||||||
else
|
|
||||||
e.parentNode.removeClassName("Selected");
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
selectActions: function (select) {
|
selectActions: function (select) {
|
||||||
$$("#filterDlg_Actions input[type=checkbox]").each(function (e) {
|
Lists.select("filterDlg_Actions", select);
|
||||||
e.checked = select;
|
|
||||||
|
|
||||||
if (select)
|
|
||||||
e.parentNode.addClassName("Selected");
|
|
||||||
else
|
|
||||||
e.parentNode.removeClassName("Selected");
|
|
||||||
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
editRule: function (e) {
|
editRule: function (e) {
|
||||||
const li = e.parentNode;
|
const li = e.parentNode;
|
||||||
|
|||||||
@@ -153,24 +153,10 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
|
|||||||
Filters.editFilterTest(query);
|
Filters.editFilterTest(query);
|
||||||
},
|
},
|
||||||
selectRules: function (select) {
|
selectRules: function (select) {
|
||||||
$$("#filterDlg_Matches input[type=checkbox]").each(function (e) {
|
Lists.select("filterDlg_Matches", select);
|
||||||
e.checked = select;
|
|
||||||
if (select)
|
|
||||||
e.parentNode.addClassName("Selected");
|
|
||||||
else
|
|
||||||
e.parentNode.removeClassName("Selected");
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
selectActions: function (select) {
|
selectActions: function (select) {
|
||||||
$$("#filterDlg_Actions input[type=checkbox]").each(function (e) {
|
Lists.select("filterDlg_Actions", select);
|
||||||
e.checked = select;
|
|
||||||
|
|
||||||
if (select)
|
|
||||||
e.parentNode.addClassName("Selected");
|
|
||||||
else
|
|
||||||
e.parentNode.removeClassName("Selected");
|
|
||||||
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
editRule: function (e) {
|
editRule: function (e) {
|
||||||
const li = e.parentNode;
|
const li = e.parentNode;
|
||||||
|
|||||||
18
js/common.js
18
js/common.js
@@ -56,7 +56,23 @@ const Lists = {
|
|||||||
|
|
||||||
if (row)
|
if (row)
|
||||||
checked ? row.addClassName("Selected") : row.removeClassName("Selected");
|
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
|
// noinspection JSUnusedGlobalSymbols
|
||||||
|
|||||||
Reference in New Issue
Block a user