Skip to content

Commit 5c969cd

Browse files
committed
Add extra loading hook, and remove close call for typonjs compat Fixes #89
1 parent 35784a3 commit 5c969cd

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ Hooks.callAll("PopOut:popout", app, popout);
8282
// node: is the html element of the application after it has been moved to the new window.
8383
Hooks.callAll("Popout:loaded", app, node);
8484

85+
// app: is the foundry application being popped out.
86+
// popout: is the browser window object where the popped out element will be moved.
87+
Hooks.callAll("Popout:loading", app, popout);
88+
8589
// app: is the foundry application being popped in.
8690
Hooks.callAll("PopOut:popin", app);
8791

popout.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,8 @@ class PopoutModule {
577577

578578
// -------------------- Add unload handlers --------------------
579579

580+
Hooks.callAll("PopOut:loading", app, popout); // eslint-disable-line no-undef
581+
580582
window.addEventListener("unload", async (event) => {
581583
this.log("Unload event", event);
582584
const appId = app.appId;
@@ -837,7 +839,6 @@ class PopoutModule {
837839
} else {
838840
if (game.keyboard.downKeys.has("Escape")) return; // eslint-disable-line no-undef
839841
}
840-
popout.close();
841842
return oldClose.apply(app, args);
842843
};
843844

0 commit comments

Comments
 (0)