diff options
Diffstat (limited to 'js/PrefFeedTree.js')
-rw-r--r-- | js/PrefFeedTree.js | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/js/PrefFeedTree.js b/js/PrefFeedTree.js index a2a7f9141..bb5d25e67 100644 --- a/js/PrefFeedTree.js +++ b/js/PrefFeedTree.js @@ -300,9 +300,8 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_b try { const dialog = new fox.SingleUseDialog({ - id: "feedEditDlg", title: __("Edit Multiple Feeds"), - getChildByName: function (name) { + /*getChildByName: function (name) { let rv = null; this.getChildren().forEach( function (child) { @@ -312,16 +311,22 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_b } }); return rv; - }, - toggleField: function (checkbox, elem, label) { - this.getChildByName(elem).attr('disabled', !checkbox.checked); + },*/ + toggleField: function (checkbox) { + const name = checkbox.attr("data-control-for"); + const target = dijit.getEnclosingWidget(dialog.domNode.querySelector(`input[name="${name}"]`)); - if ($(label)) - if (checkbox.checked) - $(label).removeClassName('text-muted'); - else - $(label).addClassName('text-muted'); + target.attr('disabled', !checkbox.attr('checked')); + console.log(target, target.attr('type')); + + if (target.attr('type') == "checkbox") { + const label = checkbox.domNode.closest("label"); + if (checkbox.attr('checked')) + label.removeClassName('text-muted'); + else + label.addClassName('text-muted'); + } }, execute: function () { if (this.validate() && confirm(__("Save changes to selected feeds?"))) { |