Skip to content

Commit d3da5e2

Browse files
committed
Mica element getter (nssave for now) need safe neeadneda
1 parent 0556253 commit d3da5e2

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Scripts/WindowManager.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ function Dialog(object, create) {
6868
this.minWidth = 100;
6969
this.minHeight = 200;
7070
this.mica = true;
71+
// /** @type {HTMLElement} */
72+
// this.micaElement = true;
7173

7274
if (!object) return;
7375
if (!create) create = false;
@@ -384,6 +386,14 @@ Object.defineProperty(Dialog.prototype, "popup", {
384386
get: function() { return this._popupWindow; }
385387
});
386388

389+
Object.defineProperty(Dialog.prototype, "micaElement", {
390+
get: function() {
391+
var elem = this.target.getElementsByClassName("backdrop-clip")[0].children[0];
392+
if ( elem instanceof HTMLElement) return elem;
393+
return null;
394+
}
395+
});
396+
387397
/** @type {Dialog} */
388398
/*let*/var focusedDialog = null;
389399
Dialog.prototype.focus = function() {
@@ -483,6 +493,7 @@ Dialog.prototype.injectMica = function () {
483493
var clip = this.target.getElementsByClassName("backdrop-clip")[0];
484494
image.classList.add("mica");
485495
clip.appendChild(image);
496+
this.move(this.x, this.y);
486497
}
487498

488499
/**

0 commit comments

Comments
 (0)