dialogOf: deal with both raw DOM elements and widgets

This commit is contained in:
Andrew Dolgov 2021-02-12 12:12:12 +03:00
parent 20fb056323
commit a72171f8ef
1 changed files with 6 additions and 2 deletions

View File

@ -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);