remove: PluginCEBase#_loadPersist
This commit is contained in:
parent
cb564009e3
commit
f5146fe86a
|
|
@ -62,28 +62,4 @@ export class PluginCEBase extends XULElementBase {
|
|||
});
|
||||
return dom;
|
||||
}
|
||||
|
||||
_loadPersist() {
|
||||
const persistValues = Zotero.Prefs.get("pane.persist") as string;
|
||||
if (!persistValues) return;
|
||||
const serializedValues = JSON.parse(persistValues) as Record<
|
||||
string,
|
||||
Record<string, string>
|
||||
>;
|
||||
|
||||
for (const id in serializedValues) {
|
||||
const el = this.querySelector(`#${id}`) as HTMLElement;
|
||||
if (!el) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const elValues = serializedValues[id];
|
||||
for (const attr in elValues) {
|
||||
el.setAttribute(attr, elValues[attr]);
|
||||
if (["width", "height"].includes(attr)) {
|
||||
el.style[attr as any] = `${elValues[attr]}px`;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,8 +139,6 @@ export class OutlinePane extends PluginCEBase {
|
|||
["item"],
|
||||
"attachmentsBox",
|
||||
);
|
||||
|
||||
this._loadPersist();
|
||||
}
|
||||
|
||||
destroy(): void {
|
||||
|
|
|
|||
|
|
@ -82,8 +82,6 @@ export class Workspace extends PluginCEBase {
|
|||
|
||||
this._context = this._queryID("right-container") as unknown as ContextPane;
|
||||
|
||||
this._loadPersist();
|
||||
|
||||
this.resizeOb = new ResizeObserver(() => {
|
||||
if (!this.editor) return;
|
||||
this._addon.api.editor.scroll(
|
||||
|
|
|
|||
Loading…
Reference in New Issue