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: https://develop.svn.wordpress.org/trunk@21970 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-09-24 16:25:15 +00:00
parent 65804be624
commit a7175db279
1 changed files with 7 additions and 0 deletions

View File

@ -299,6 +299,13 @@ jQuery(document).ready( function($) {
// Ajax Cat
$('#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(); });
syncChecks = function() {