Message info
 
To:wp-svn@lists.automattic.com From:m@wordpress.org Subject:[wp-svn] [21024] trunk: Customizer: Add keyup events to sync textarea values. Date:Thu, 7 Jun 2012 22:00:59 +0000 (UTC)
 

Revision
21024
Author
ryan
Date
2012-06-07 22:00:59 +0000 (Thu, 07 Jun 2012)

Log Message

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

Modified Paths

Diff

Modified: trunk/wp-admin/js/customize-controls.dev.js (21023 => 21024)


--- trunk/wp-admin/js/customize-controls.dev.js	2012-06-07 17:58:27 UTC (rev 21023)
+++ trunk/wp-admin/js/customize-controls.dev.js	2012-06-07 22:00:59 UTC (rev 21024)
@@ -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();
 		});

Modified: trunk/wp-includes/js/customize-base.dev.js (21023 => 21024)


--- trunk/wp-includes/js/customize-base.dev.js	2012-06-07 17:58:27 UTC (rev 21023)
+++ trunk/wp-includes/js/customize-base.dev.js	2012-06-07 22:00:59 UTC (rev 21024)
@@ -406,6 +406,8 @@
 						synchronizer = api.Element.synchronizer[ type ];
 					if ( 'text' === type || 'password' === type )
 						this.events += ' keyup';
+				} else if ( this.element.is('textarea') ) {
+					this.events += ' keyup';
 				}
 			}