Skip to content

Commit

Permalink
fix: compat.registerPrefPane window size
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangyu committed Dec 24, 2022
1 parent 9c29e9a commit 6a21438
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 1 addition & 6 deletions package.json
Expand Up @@ -5,7 +5,6 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"release": "release-it",
"build": "tsc && api-extractor run --local --verbose && api-documenter markdown --input-folder ./temp --output-folder ./docs"
},
"repository": {
Expand All @@ -24,10 +23,6 @@
"url": "https://github.com/windingwind/zotero-plugin-toolkit/issues"
},
"homepage": "https://github.com/windingwind/zotero-plugin-toolkit#readme",
"devDependencies": {
"@microsoft/api-extractor": "^7.33.7",
"release-it": "^15.5.1"
},
"dependencies": {
"zotero-types": "^0.1.2"
},
Expand All @@ -44,4 +39,4 @@
"lib": "dist",
"doc": "docs"
}
}
}
3 changes: 3 additions & 0 deletions src/compat.ts
Expand Up @@ -360,6 +360,9 @@ export class ZoteroCompat {
const prefPane = win.document.querySelector(`#${options.id}`);
// @ts-ignore
prefWindow.addPane(prefPane);
// Resize window, otherwise the new prefpane may be placed out of the window
// @ts-ignore
win.sizeToContent();
this.prefPaneCache.win = win;
this.prefPaneCache.listeners.push(windowListener);
this.prefPaneCache.ids.push(options.id);
Expand Down

0 comments on commit 6a21438

Please sign in to comment.