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:
Ella Iseulde Van Dorpe 2015-06-18 12:58:07 +00:00
parent f88225549e
commit 9941421f72
1 changed files with 3 additions and 2 deletions

View File

@ -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;
}