mirror of
https://github.com/fastmail/Squire.git
synced 2025-01-18 04:32:28 -05:00
Ignore "cut" if no selection
This commit is contained in:
parent
e645489f5f
commit
066bdd2cde
3 changed files with 14 additions and 2 deletions
|
@ -2165,6 +2165,12 @@ var onCut = function ( event ) {
|
||||||
var root = this._root;
|
var root = this._root;
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
// Nothing to do
|
||||||
|
if ( range.collapsed ) {
|
||||||
|
event.preventDefault();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Save undo checkpoint
|
// Save undo checkpoint
|
||||||
this.saveUndoState( range );
|
this.saveUndoState( range );
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -38,6 +38,12 @@ var onCut = function ( event ) {
|
||||||
var root = this._root;
|
var root = this._root;
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
// Nothing to do
|
||||||
|
if ( range.collapsed ) {
|
||||||
|
event.preventDefault();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Save undo checkpoint
|
// Save undo checkpoint
|
||||||
this.saveUndoState( range );
|
this.saveUndoState( range );
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue