From f06a9763c384d349af63a9261ebfb982dfc9336a Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Sat, 8 Nov 2008 06:54:42 +0000 Subject: [PATCH] Press Enter to save in Quick Edit, props aaron_guitar, fixes #8061 git-svn-id: https://develop.svn.wordpress.org/trunk@9566 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/js/inline-edit-post.js | 1 + wp-admin/js/inline-edit-tax.js | 1 + wp-includes/script-loader.php | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-admin/js/inline-edit-post.js b/wp-admin/js/inline-edit-post.js index e3dbf30977..51baef867d 100644 --- a/wp-admin/js/inline-edit-post.js +++ b/wp-admin/js/inline-edit-post.js @@ -20,6 +20,7 @@ inlineEditPost = { $('a.cancel', qeRow).click(function() { return inlineEditPost.revert(); }); $('a.save', qeRow).click(function() { return inlineEditPost.save(this); }); + $('input, select', qeRow).keydown(function(e) { if(e.which == 13) return inlineEditPost.save(this); }); $('a.cancel', bulkRow).click(function() { return inlineEditPost.revert(); }); $('a.save', bulkRow).click(function() { return inlineEditPost.saveBulk(); }); diff --git a/wp-admin/js/inline-edit-tax.js b/wp-admin/js/inline-edit-tax.js index 9d258c0f29..dc5a9e1b5f 100644 --- a/wp-admin/js/inline-edit-tax.js +++ b/wp-admin/js/inline-edit-tax.js @@ -17,6 +17,7 @@ inlineEditTax = { $('a.cancel', row).click(function() { return inlineEditTax.revert(); }); $('a.save', row).click(function() { return inlineEditTax.save(this); }); + $('input, select', row).keydown(function(e) { if(e.which == 13) return inlineEditTax.save(this); }); // add events // t.rows.dblclick(function() { inlineEditTax.toggle(this); }); diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index dadb717c7d..d643da34c6 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -263,12 +263,12 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'theme-preview', '/wp-admin/js/theme-preview.js', array( 'thickbox', 'jquery' ), '20080625' ); - $scripts->add( 'inline-edit-post', '/wp-admin/js/inline-edit-post.js', array( 'jquery', 'jquery-form', 'suggest' ), '20081031' ); + $scripts->add( 'inline-edit-post', '/wp-admin/js/inline-edit-post.js', array( 'jquery', 'jquery-form', 'suggest' ), '20081107' ); $scripts->localize( 'inline-edit-post', 'inlineEditL10n', array( 'error' => __('Error while saving the changes.') ) ); - $scripts->add( 'inline-edit-tax', '/wp-admin/js/inline-edit-tax.js', array( 'jquery', 'jquery-form' ), '20081031' ); + $scripts->add( 'inline-edit-tax', '/wp-admin/js/inline-edit-tax.js', array( 'jquery', 'jquery-form' ), '20081107' ); $scripts->localize( 'inline-edit-tax', 'inlineEditL10n', array( 'error' => __('Error while saving the changes.') ) );