Skip to content

Commit 489ec63

Browse files
committed
Eject fixes
1 parent b0c2b6b commit 489ec63

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

Scripts/WindowManager.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ function Dialog(object) {
6161

6262
// this.closeable = false;
6363

64-
/** @type {string?} */
65-
this.href = null;
64+
// /** @type {string?} */
65+
// this.href = null;
6666

6767
if (!object) return;
6868
const dialog = this;
@@ -184,7 +184,7 @@ function Dialog(object) {
184184
top: rect.top + viewboxPosition.top
185185
}
186186

187-
window.open(dialog.getElementsByTagName("iframe")[0].contentDialog.location.href, windows[dialog.id].title, stringifyDialogProperties(propeties) /*"scrollbars=yes,resizable=yes,status=no,location=yes,toolbar=no,menubar=no,width=10,height=10,left=100,top=100"*/);
187+
window.open(this.href, windows[dialog.id].title, stringifyDialogProperties(propeties) /*"scrollbars=yes,resizable=yes,status=no,location=yes,toolbar=no,menubar=no,width=10,height=10,left=100,top=100"*/);
188188
});
189189

190190
const buttons = target.getElementsByTagName("button");
@@ -321,7 +321,7 @@ Dialog.prototype.initWithObject = function (object) {
321321
top: rect.top + viewboxPosition.top
322322
}
323323

324-
window.open(dialog.getElementsByTagName("iframe")[0].contentDialog.location.href, windows[dialog.id].title, stringifyDialogProperties(propeties) /*"scrollbars=yes,resizable=yes,status=no,location=yes,toolbar=no,menubar=no,width=10,height=10,left=100,top=100"*/);
324+
window.open(this.href, windows[dialog.id].title, stringifyDialogProperties(propeties) /*"scrollbars=yes,resizable=yes,status=no,location=yes,toolbar=no,menubar=no,width=10,height=10,left=100,top=100"*/);
325325
});
326326

327327
const buttons = target.getElementsByTagName("button");
@@ -493,13 +493,12 @@ Dialog.prototype.setClickOffset = function (x, y) {
493493
return this.clickOffset.x = x, this.clickOffset.y = y, this.clickOffset.height = window.height || rect.height, this.clickOffset.width = window.width || rect.width, this.clickOffset.top = rect.top, this.clickOffset.left = rect.left, this.clickOffset.stats.reset();
494494
}
495495
Dialog.prototype.verifyEjectCapability = function () {
496-
try {
497-
return this.frame.contentDialog.document || this.frame.contentDocument !== null;
498-
} catch (e) {
499-
console.error("Failed to uh eject button", e);
500-
return false;
501-
}
496+
return !!(this.href);
502497
};
498+
Object.defineProperty(Dialog.prototype, "href", { get: function () {
499+
if (!this.application) return false;
500+
return this.application.src;
501+
}});
503502
Dialog.prototype.togglePointerEvents = function (enable) {
504503
if (enable == null) enable = this.target.style.pointerEvents == "none";
505504
const events = enable ? "auto" : "none";

0 commit comments

Comments
 (0)