parent
5fcac10db9
commit
c4fde7ebbf
2 changed files with 9 additions and 8 deletions
|
@ -230,15 +230,16 @@ var ZoteroItemPane = new function() {
|
|||
}
|
||||
|
||||
var noteEditor = document.getElementById('zotero-note-editor');
|
||||
noteEditor.mode = editable ? 'edit' : 'view';
|
||||
|
||||
noteEditor.parent = null;
|
||||
noteEditor.item = item;
|
||||
|
||||
// If loading new or different note, disable undo while we repopulate the text field
|
||||
// so Undo doesn't end up clearing the field. This also ensures that Undo doesn't
|
||||
// undo content from another note into the current one.
|
||||
var clearUndo = noteEditor.item ? noteEditor.item.id != item.id : false;
|
||||
|
||||
noteEditor.mode = editable ? 'edit' : 'view';
|
||||
noteEditor.parent = null;
|
||||
noteEditor.item = item;
|
||||
|
||||
if (clearUndo) {
|
||||
noteEditor.clearUndo();
|
||||
}
|
||||
|
|
|
@ -44,13 +44,13 @@ async function onLoad() {
|
|||
if (itemID) {
|
||||
var ref = await Zotero.Items.getAsync(itemID);
|
||||
|
||||
var clearUndo = noteEditor.item ? noteEditor.item.id != ref.id : false;
|
||||
|
||||
noteEditor.item = ref;
|
||||
|
||||
// If loading new or different note, disable undo while we repopulate the text field
|
||||
// so Undo doesn't end up clearing the field. This also ensures that Undo doesn't
|
||||
// undo content from another note into the current one.
|
||||
let clearUndo = noteEditor.item ? noteEditor.item.id != itemID : false;
|
||||
|
||||
noteEditor.item = ref;
|
||||
|
||||
if (clearUndo) {
|
||||
noteEditor.clearUndo();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue