Skip to content

Commit 4e08d68

Browse files
committed
fix v13 compatibility for content links
Skip jQuery event handlers for content links in v13 where they are no longer needed
1 parent bf24591 commit 4e08d68

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

module.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "popout",
33
"title": "PopOut!",
44
"description": "<p>This module adds a PopOut! button to most actor sheets, journal entries, and applications.</p><p>The PopOut! button allows you to open a sheet/application/document into its own window, for easier viewing or for use with multiple monitors.</p>",
5-
"version": "2.19",
5+
"version": "2.20",
66
"authors": [{ "name": "KaKaRoTo" }, { "name": "Posnet" }],
77
"scripts": ["./popout.js"],
88
"styles": [],
@@ -48,7 +48,7 @@
4848
"readme": "https://github.com/League-of-Foundry-Developers/fvtt-module-popout#readme",
4949
"url": "https://github.com/League-of-Foundry-Developers/fvtt-module-popout",
5050
"manifest": "https://raw.githubusercontent.com/League-of-Foundry-Developers/fvtt-module-popout/master/module.json",
51-
"download": "https://github.com/League-of-Foundry-Developers/fvtt-module-popout/archive/v2.19.zip",
51+
"download": "https://github.com/League-of-Foundry-Developers/fvtt-module-popout/archive/v2.20.zip",
5252
"bugs": "https://github.com/League-of-Foundry-Developers/fvtt-module-popout/issues",
5353
"compatibility": {
5454
"minimum": "12",

popout.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,20 +1120,22 @@ class PopoutModule {
11201120
// Only attach jQuery delegated events for ApplicationV1
11211121
if (!isApplicationV2) {
11221122
const jBody = $(body);
1123-
jBody.on(
1124-
"click",
1125-
"a.content-link",
1126-
window.TextEditor._onClickEntityLink !== undefined
1127-
? window.TextEditor._onClickEntityLink
1128-
: window.TextEditor._onClickContentLink,
1129-
);
1130-
jBody.on(
1131-
"dragstart",
1132-
"a.content-link",
1133-
window.TextEditor._onDragEntityLink !== undefined
1134-
? window.TextEditor._onDragEntityLink
1135-
: window.TextEditor._onDragContentLink,
1136-
);
1123+
if (game.release.generation < 13) {
1124+
jBody.on(
1125+
"click",
1126+
"a.content-link",
1127+
window.TextEditor._onClickEntityLink !== undefined
1128+
? window.TextEditor._onClickEntityLink
1129+
: window.TextEditor._onClickContentLink,
1130+
);
1131+
jBody.on(
1132+
"dragstart",
1133+
"a.content-link",
1134+
window.TextEditor._onDragEntityLink !== undefined
1135+
? window.TextEditor._onDragEntityLink
1136+
: window.TextEditor._onDragContentLink,
1137+
);
1138+
}
11371139
jBody.on(
11381140
"click",
11391141
"a.inline-roll",

0 commit comments

Comments
 (0)