mirror of
https://github.com/zotero/zotero.git
synced 2026-10-05 02:43:38 +00:00
parent
46385b06fa
commit
47e6a0f7ab
3 changed files with 24 additions and 2 deletions
|
|
@ -73,12 +73,18 @@ Zotero.Notes = new function () {
|
|||
if (noteEditor.viewMode === 'tab') {
|
||||
win.Zotero_Tabs.select(noteEditor.tabID, true);
|
||||
}
|
||||
else {
|
||||
noteEditor.focus();
|
||||
}
|
||||
|
||||
if (location) {
|
||||
// TODO: implement this
|
||||
noteEditor.navigate(location);
|
||||
}
|
||||
return noteEditor;
|
||||
}
|
||||
else if (openInWindow) {
|
||||
|
||||
if (openInWindow) {
|
||||
let name = null;
|
||||
|
||||
if (itemID) {
|
||||
|
|
|
|||
|
|
@ -49,6 +49,18 @@ class EditorInstance {
|
|||
this.instanceID = Zotero.Utilities.randomString();
|
||||
}
|
||||
|
||||
get itemID() {
|
||||
return this._item.id;
|
||||
}
|
||||
|
||||
get viewMode() {
|
||||
return this._viewMode;
|
||||
}
|
||||
|
||||
set viewMode(mode) {
|
||||
this._viewMode = mode;
|
||||
}
|
||||
|
||||
async init(options) {
|
||||
Zotero.Notes.registerEditorInstance(this);
|
||||
this.onNavigate = options.onNavigate;
|
||||
|
|
@ -250,6 +262,7 @@ class EditorInstance {
|
|||
}
|
||||
|
||||
focus() {
|
||||
this._iframeWindow.focus();
|
||||
this._postMessage({ action: 'focus' });
|
||||
}
|
||||
|
||||
|
|
@ -322,6 +335,9 @@ class EditorInstance {
|
|||
preserveSelection
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: implement navigating to note editor location
|
||||
navigate(_location) {}
|
||||
|
||||
_postMessage(message) {
|
||||
this._iframeWindow.postMessage({ instanceID: this.instanceID, message }, '*');
|
||||
|
|
|
|||
|
|
@ -4655,7 +4655,7 @@ var ZoteroPane = new function () {
|
|||
openInWindow = Zotero.Prefs.get('openNoteInNewWindow');
|
||||
}
|
||||
|
||||
return Zotero.Notes.open(itemID, {}, {
|
||||
return Zotero.Notes.open(itemID, undefined, {
|
||||
openInWindow,
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue