mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 22:45:56 +00:00
SingleUseDialog: destroy existing widget with same id on create
This commit is contained in:
@@ -1,6 +1,17 @@
|
|||||||
|
/* eslint-disable prefer-rest-params */
|
||||||
/* global dijit, define */
|
/* global dijit, define */
|
||||||
define(["dojo/_base/declare", "dijit/Dialog"], function (declare) {
|
define(["dojo/_base/declare", "dijit/Dialog"], function (declare) {
|
||||||
return declare("fox.SingleUseDialog", dijit.Dialog, {
|
return declare("fox.SingleUseDialog", dijit.Dialog, {
|
||||||
|
create: function(params) {
|
||||||
|
const extant = dijit.byId(params.id);
|
||||||
|
|
||||||
|
if (extant) {
|
||||||
|
console.warn('SingleUseDialog: destroying existing widget:', params.id, '=', extant)
|
||||||
|
extant.destroyRecursive();
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.inherited(arguments);
|
||||||
|
},
|
||||||
onHide: function() {
|
onHide: function() {
|
||||||
this.destroyRecursive();
|
this.destroyRecursive();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user