Hitting return when adding a new category from the category meta box should add the new category, not submit the post form. props wojtek.szkutnik, fixes #14312.

git-svn-id: http://core.svn.wordpress.org/trunk@21970 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2012-09-24 16:25:15 +00:00
parent 43d0bc1ed7
commit 469a77d74c
1 changed files with 7 additions and 0 deletions

View File

@ -299,6 +299,13 @@ jQuery(document).ready( function($) {
// Ajax Cat // Ajax Cat
$('#new' + taxonomy).one( 'focus', function() { $(this).val( '' ).removeClass( 'form-input-tip' ) } ); $('#new' + taxonomy).one( 'focus', function() { $(this).val( '' ).removeClass( 'form-input-tip' ) } );
$('#new' + taxonomy).keypress( function(event){
if( 13 === event.keyCode ) {
event.preventDefault();
$('#' + taxonomy + '-add-submit').click();
}
});
$('#' + taxonomy + '-add-submit').click( function(){ $('#new' + taxonomy).focus(); }); $('#' + taxonomy + '-add-submit').click( function(){ $('#new' + taxonomy).focus(); });
syncChecks = function() { syncChecks = function() {