Make WordPress Core

Changeset 21970


Ignore:
Timestamp:
09/24/2012 04:25:15 PM (12 years ago)
Author:
nacin
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/post.js

    r21947 r21970  
    300300        // Ajax Cat
    301301        $('#new' + taxonomy).one( 'focus', function() { $(this).val( '' ).removeClass( 'form-input-tip' ) } );
     302
     303        $('#new' + taxonomy).keypress( function(event){
     304            if( 13 === event.keyCode ) {
     305                 event.preventDefault();
     306                 $('#' + taxonomy + '-add-submit').click();
     307            }
     308        });
    302309        $('#' + taxonomy + '-add-submit').click( function(){ $('#new' + taxonomy).focus(); });
    303310
Note: See TracChangeset for help on using the changeset viewer.