WordPress.org

Make WordPress Core

Changeset 21970


Ignore:
Timestamp:
09/24/12 16:25:15 (19 months 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.