Skip to content

Commit

Permalink
fix: dialog did not open properly
Browse files Browse the repository at this point in the history
fix: #78, fix: #130
  • Loading branch information
northword committed Jan 24, 2024
1 parent be050b2 commit e8c5887
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- 尝试修复富文本标题框部分情况下无法正确新建的问题。/ Fix the rich text toolbar not being properly opened in some cases. fix: [#130](https://github.com/northword/zotero-format-metadata/issues/130), ref:[#78](https://github.com/northword/zotero-format-metadata/issues/78)

## [1.9.0] - 2024-01-14

### Added
Expand Down
6 changes: 5 additions & 1 deletion src/modules/views/richTextToolBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class richTextToolBar {
const dialogData: { [key: string | number]: unknown } = {
loadCallback: () => {
// ztoolkit.log(dialogData, "Dialog Opened!");
addon.data.dialogs.richTextToolBar = toolBarPanel;
addon.data.dialogs.richTextToolBar ??= toolBarPanel;
},
unloadCallback: () => {
const win = addon.data.dialogs?.richTextToolBar?.window as Window;
Expand Down Expand Up @@ -135,7 +135,11 @@ export class richTextToolBar {
// let addon.data.dialog.richTextToolBar: DialogHelper;
if (addon.data.dialogs.richTextToolBar == undefined) {
addon.data.dialogs.richTextToolBar = this.creatRichTextDialog();
} else {
ztoolkit.log("addon.data.dialogs.richTextToolBar 已存在,不再打开");
return;
}

addon.data.dialogs.richTextToolBar.open("Zotero Format Metadata Rich Text Tool Bar", windowFuture);
}

Expand Down

0 comments on commit e8c5887

Please sign in to comment.