parent
5fcac10db9
commit
c4fde7ebbf
|
@ -230,15 +230,16 @@ var ZoteroItemPane = new function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
var noteEditor = document.getElementById('zotero-note-editor');
|
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
|
// 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
|
// 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.
|
// undo content from another note into the current one.
|
||||||
var clearUndo = noteEditor.item ? noteEditor.item.id != item.id : false;
|
var clearUndo = noteEditor.item ? noteEditor.item.id != item.id : false;
|
||||||
|
|
||||||
|
noteEditor.mode = editable ? 'edit' : 'view';
|
||||||
|
noteEditor.parent = null;
|
||||||
|
noteEditor.item = item;
|
||||||
|
|
||||||
if (clearUndo) {
|
if (clearUndo) {
|
||||||
noteEditor.clearUndo();
|
noteEditor.clearUndo();
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,13 +44,13 @@ async function onLoad() {
|
||||||
if (itemID) {
|
if (itemID) {
|
||||||
var ref = await Zotero.Items.getAsync(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
|
// 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
|
// 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.
|
// undo content from another note into the current one.
|
||||||
|
let clearUndo = noteEditor.item ? noteEditor.item.id != itemID : false;
|
||||||
|
|
||||||
|
noteEditor.item = ref;
|
||||||
|
|
||||||
if (clearUndo) {
|
if (clearUndo) {
|
||||||
noteEditor.clearUndo();
|
noteEditor.clearUndo();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user