Skip to content

Commit

Permalink
Merge pull request #41 from kgar/og-tidy-hack-fix
Browse files Browse the repository at this point in the history
[#40] Updates `hack` function to support varying numbers of parent Item Sheet classes
  • Loading branch information
PwQt authored Jan 14, 2024
2 parents f2c8725 + 38723a7 commit f4042e0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/scripts/magicItemtab.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,16 @@ export class MagicItemTab {

hack(app) {
let tab = this;
app.setPosition = function (position = {}) {
app.setPosition = function(position = {}) {
position.height = tab.isActive() && !position.height ? "auto" : position.height;
return this.__proto__.__proto__.setPosition.apply(this, [position]);
let that = this;
for (let i = 0; i < 100; i++) {
if (that.constructor.name === ItemSheet.name) {
break;
}
that = Object.getPrototypeOf(that);
}
return that.setPosition.apply(this, [position]);
};
}

Expand Down

0 comments on commit f4042e0

Please sign in to comment.