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

git-svn-id: http://core.svn.wordpress.org/trunk@21024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2012-06-07 22:00:59 +00:00
parent 882813ef82
commit 6e0e62a063
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';
}
}