TinyMCE: wptextpattern: escape should undo
Props azaozz. See #31441. git-svn-id: https://develop.svn.wordpress.org/trunk@32836 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f88225549e
commit
9941421f72
@ -13,6 +13,7 @@
|
||||
( function( tinymce, setTimeout ) {
|
||||
tinymce.PluginManager.add( 'wptextpattern', function( editor ) {
|
||||
var $$ = editor.$,
|
||||
VK = tinymce.util.VK,
|
||||
patterns = [],
|
||||
canUndo = false;
|
||||
|
||||
@ -52,7 +53,7 @@
|
||||
} );
|
||||
|
||||
editor.on( 'keydown', function( event ) {
|
||||
if ( canUndo && event.keyCode === tinymce.util.VK.BACKSPACE ) {
|
||||
if ( canUndo && ( event.keyCode === VK.BACKSPACE || event.keyCode === 27 /* ESCAPE */ ) ) {
|
||||
editor.undoManager.undo();
|
||||
event.preventDefault();
|
||||
}
|
||||
@ -61,7 +62,7 @@
|
||||
editor.on( 'keyup', function( event ) {
|
||||
var rng, node, text, parent, child;
|
||||
|
||||
if ( event.keyCode !== tinymce.util.VK.SPACEBAR ) {
|
||||
if ( event.keyCode !== VK.SPACEBAR ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user