More efficient category and list JS from mdawaffe. fixes #6677 for trunk

git-svn-id: http://svn.automattic.com/wordpress/trunk@7669 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2008-04-14 19:31:20 +00:00
parent 7d2a7755a3
commit 8eff77e82d
5 changed files with 28 additions and 19 deletions

View File

@@ -313,11 +313,11 @@ var wpList = {
var addEl = this;
var c = wpList.parseClass(this,'add')[2] || addEl.id;
if ( !c ) { return; }
var forms = []; var ins = [];
var forms = []; var ins = []; // this is all really inefficient
$('#' + c + ' :input').focus( function() { currentFormEl = this; } ).blur( function() { currentFormEl = false; } ).each( function() {
ins.push(this);
$.merge(forms,$(this).parents('form'));
forms = $.unique(forms);
var f = $(this).parents('form:first').get(0);
if ( $.inArray(f,forms) < 0 ) { forms.push(f); }
} );
$(forms).submit( function() {
if ( 0 <= $.inArray(currentFormEl,ins) ) {

View File

@@ -57,7 +57,7 @@ class WP_Scripts {
'whoaText' => __("Slow down, I'm still sending your data!")
) );
$this->add( 'wp-lists', '/wp-includes/js/wp-lists.js', array('wp-ajax-response'), '20080322' );
$this->add( 'wp-lists', '/wp-includes/js/wp-lists.js', array('wp-ajax-response'), '20080411' );
$this->localize( 'wp-lists', 'wpListL10n', array(
'url' => get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php'
) );
@@ -144,7 +144,7 @@ class WP_Scripts {
'save' => __('Save'),
'cancel' => __('Cancel'),
) );
$this->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug'), '20080322' );
$this->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug'), '20080411' );
$this->localize( 'post', 'postL10n', array(
'tagsUsed' => __('Tags used on this post:'),
'add' => attribute_escape(__('Add')),