mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 07:13:08 -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 self = this;
|
||||
|
||||
// Nothing to do
|
||||
if ( range.collapsed ) {
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
// Save undo checkpoint
|
||||
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 self = this;
|
||||
|
||||
// Nothing to do
|
||||
if ( range.collapsed ) {
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
// Save undo checkpoint
|
||||
this.saveUndoState( range );
|
||||
|
||||
|
|
Loading…
Reference in a new issue