Customizer: Add keyup events to sync textarea values. Props koopersmith. fixes #20879

git-svn-id: https://develop.svn.wordpress.org/trunk@21024 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2012-06-07 22:00:59 +00:00
parent 8fac41f47a
commit 5abcaa52d7
2 changed files with 5 additions and 0 deletions

View File

@ -573,6 +573,9 @@
// Prevent the form from saving when enter is pressed.
$('#customize-controls').on( 'keydown', function( e ) {
if ( $( e.target ).is('textarea') )
return;
if ( 13 === e.which ) // Enter
e.preventDefault();
});

View File

@ -406,6 +406,8 @@ if ( typeof wp === 'undefined' )
synchronizer = api.Element.synchronizer[ type ];
if ( 'text' === type || 'password' === type )
this.events += ' keyup';
} else if ( this.element.is('textarea') ) {
this.events += ' keyup';
}
}