mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-26 09:03:48 +08:00
Track the inUndoState
This commit is contained in:
parent
7e2cc69a23
commit
5d6fb0c705
2 changed files with 5 additions and 4 deletions
1
dev/External/SquireUI.js
vendored
1
dev/External/SquireUI.js
vendored
|
@ -619,6 +619,7 @@ class SquireUI
|
|||
// Move cursor above signature
|
||||
div.before(br);
|
||||
div.before(br.cloneNode());
|
||||
// squire._docWasChanged();
|
||||
}
|
||||
this._prev_txt_sig = signature;
|
||||
} catch (e) {
|
||||
|
|
8
vendors/squire/build/squire-raw.js
vendored
8
vendors/squire/build/squire-raw.js
vendored
|
@ -2034,14 +2034,14 @@ class EditStack extends Array
|
|||
this[undoIndex] = html;
|
||||
this.index = undoIndex;
|
||||
this.inUndoState = true;
|
||||
} else {
|
||||
console.error('EditStack in inUndoState');
|
||||
}
|
||||
}
|
||||
|
||||
saveUndoState(range) {
|
||||
let squire = this.squire;
|
||||
if (range === undefined) {
|
||||
range = squire.getSelection();
|
||||
}
|
||||
range = range || squire.getSelection();
|
||||
this.recordUndoState(range, true);
|
||||
squire._getRangeAndRemoveBookmark(range);
|
||||
}
|
||||
|
@ -2617,7 +2617,6 @@ class Squire
|
|||
const range = this._getRangeAndRemoveBookmark() || createRange(root.firstElementChild || root, 0);
|
||||
this.saveUndoState(range);
|
||||
this.setRange(range);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -3148,6 +3147,7 @@ class Squire
|
|||
let node;
|
||||
let nodeAfterSplit;
|
||||
|
||||
// TODO: why was _docWasChanged() not triggered?
|
||||
this.editStack.inUndoState && this._docWasChanged();
|
||||
this._recordUndoState(range);
|
||||
// self._config.addLinks && addLinks(range.startContainer, root);
|
||||
|
|
Loading…
Reference in a new issue