mirror of
https://github.com/fastmail/Squire.git
synced 2025-01-03 05:00:13 -05:00
Don't fire an input event on setHTML call.
This commit is contained in:
parent
249ea93c13
commit
8e8874b554
3 changed files with 9 additions and 5 deletions
|
@ -1593,7 +1593,6 @@ proto.undo = function () {
|
|||
this._recordUndoState( this.getSelection() );
|
||||
|
||||
this._undoIndex -= 1;
|
||||
this._ignoreChange = true;
|
||||
this._setHTML( this._undoStack[ this._undoIndex ] );
|
||||
var range = this._getRangeAndRemoveBookmark();
|
||||
if ( range ) {
|
||||
|
@ -1616,7 +1615,6 @@ proto.redo = function () {
|
|||
undoStackLength = this._undoStackLength;
|
||||
if ( undoIndex + 1 < undoStackLength && this._isInUndoState ) {
|
||||
this._undoIndex += 1;
|
||||
this._ignoreChange = true;
|
||||
this._setHTML( this._undoStack[ this._undoIndex ] );
|
||||
var range = this._getRangeAndRemoveBookmark();
|
||||
if ( range ) {
|
||||
|
@ -3122,6 +3120,7 @@ proto._setHTML = function ( html ) {
|
|||
do {
|
||||
fixCursor( node );
|
||||
} while ( node = getNextBlock( node ) );
|
||||
this._ignoreChange = true;
|
||||
};
|
||||
|
||||
proto.getHTML = function ( withBookMark ) {
|
||||
|
@ -3173,6 +3172,9 @@ proto.setHTML = function ( html ) {
|
|||
fixCursor( node );
|
||||
}
|
||||
|
||||
// Don't fire an input event
|
||||
this._ignoreChange = true;
|
||||
|
||||
// Remove existing body children
|
||||
var body = this._body;
|
||||
while ( child = body.lastChild ) {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -515,7 +515,6 @@ proto.undo = function () {
|
|||
this._recordUndoState( this.getSelection() );
|
||||
|
||||
this._undoIndex -= 1;
|
||||
this._ignoreChange = true;
|
||||
this._setHTML( this._undoStack[ this._undoIndex ] );
|
||||
var range = this._getRangeAndRemoveBookmark();
|
||||
if ( range ) {
|
||||
|
@ -538,7 +537,6 @@ proto.redo = function () {
|
|||
undoStackLength = this._undoStackLength;
|
||||
if ( undoIndex + 1 < undoStackLength && this._isInUndoState ) {
|
||||
this._undoIndex += 1;
|
||||
this._ignoreChange = true;
|
||||
this._setHTML( this._undoStack[ this._undoIndex ] );
|
||||
var range = this._getRangeAndRemoveBookmark();
|
||||
if ( range ) {
|
||||
|
@ -2044,6 +2042,7 @@ proto._setHTML = function ( html ) {
|
|||
do {
|
||||
fixCursor( node );
|
||||
} while ( node = getNextBlock( node ) );
|
||||
this._ignoreChange = true;
|
||||
};
|
||||
|
||||
proto.getHTML = function ( withBookMark ) {
|
||||
|
@ -2095,6 +2094,9 @@ proto.setHTML = function ( html ) {
|
|||
fixCursor( node );
|
||||
}
|
||||
|
||||
// Don't fire an input event
|
||||
this._ignoreChange = true;
|
||||
|
||||
// Remove existing body children
|
||||
var body = this._body;
|
||||
while ( child = body.lastChild ) {
|
||||
|
|
Loading…
Reference in a new issue