remove: PluginCEBase#_loadPersist

This commit is contained in:
windingwind 2024-06-20 22:38:27 +08:00
parent cb564009e3
commit f5146fe86a
3 changed files with 0 additions and 28 deletions

View File

@ -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`;
}
}
}
}
}

View File

@ -139,8 +139,6 @@ export class OutlinePane extends PluginCEBase {
["item"],
"attachmentsBox",
);
this._loadPersist();
}
destroy(): void {

View File

@ -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(