summaryrefslogtreecommitdiff
path: root/js/App.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-12 12:12:12 +0300
committerAndrew Dolgov <[email protected]>2021-02-12 12:12:12 +0300
commita72171f8ef908686ac7481c2c9ea3078960bb4ef (patch)
tree0ee2d01a4cf86a83cb85ba5d28d2bcba9d4539b5 /js/App.js
parent20fb0563233f07839a2cc59a1d197fbe282d9ffe (diff)
dialogOf: deal with both raw DOM elements and widgets
Diffstat (limited to 'js/App.js')
-rw-r--r--js/App.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/js/App.js b/js/App.js
index 6d7fd1c8b..7b7572c9b 100644
--- a/js/App.js
+++ b/js/App.js
@@ -54,8 +54,12 @@ const App = {
elem.offsetTop >= ctr.scrollTop;
}
},
- dialogOf: function (widget) {
- return dijit.getEnclosingWidget(widget.domNode.closest('.dijitDialog'));
+ dialogOf: function (elem) {
+
+ // elem could be a Dijit widget
+ elem = elem.domNode ? elem.domNode : elem;
+
+ return dijit.getEnclosingWidget(elem.closest('.dijitDialog'));
},
label_to_feed_id: function(label) {
return this.LABEL_BASE_INDEX - 1 - Math.abs(label);