summaryrefslogtreecommitdiff
path: root/js/SingleUseDialog.js
blob: 2de6f83ff23e316cb25148871cfd515736004fd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* eslint-disable prefer-rest-params */
/* global dijit, define */
define(["dojo/_base/declare", "dijit/Dialog"], function (declare) {
	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() {
         this.destroyRecursive();
      }
	});
});