Fix tags suggest for post quick edit and bulk edit

git-svn-id: http://svn.automattic.com/wordpress/trunk@10402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-01-22 12:24:25 +00:00
parent 6dd933b120
commit f254dfbbf3
3 changed files with 13 additions and 8 deletions

View File

@ -84,7 +84,7 @@ inlineEditPost = {
},
setBulk : function() {
var te = '', type = this.type;
var te = '', type = this.type, tax;
this.revert();
$('#bulk-edit td').attr('colspan', $('.widefat:first thead th:visible').length);
@ -108,12 +108,15 @@ inlineEditPost = {
});
// enable autocomplete for tags
if ( type == 'post' )
$('tr.inline-editor textarea[name="tags_input"]').suggest( 'admin-ajax.php?action=ajax-tag-search', { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } );
if ( type == 'post' ) {
// support multi taxonomies?
tax = 'post_tag';
$('tr.inline-editor textarea[name="tags_input"]').suggest( 'admin-ajax.php?action=ajax-tag-search&tax='+tax, { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } );
}
},
edit : function(id) {
var t = this, fields, editRow, rowData, cats, status, pageOpt, f, pageLevel, nextPage, pageLoop = true, nextLevel;
var t = this, fields, editRow, rowData, cats, status, pageOpt, f, pageLevel, nextPage, pageLoop = true, nextLevel, tax;
t.revert();
if ( typeof(id) == 'object' )
@ -179,8 +182,10 @@ inlineEditPost = {
$('.ptitle', editRow).focus();
// enable autocomplete for tags
if ( t.type == 'post' )
$('tr.inline-editor textarea[name="tags_input"]').suggest( 'admin-ajax.php?action=ajax-tag-search', { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } );
if ( t.type == 'post' ) {
tax = 'post_tag';
$('tr.inline-editor textarea[name="tags_input"]').suggest( 'admin-ajax.php?action=ajax-tag-search&tax='+tax, { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } );
}
return false;
},

File diff suppressed because one or more lines are too long

View File

@ -343,7 +343,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'theme-preview', "/wp-admin/js/theme-preview$suffix.js", array( 'thickbox', 'jquery' ), '20090114' );
$scripts->add_data( 'theme-preview', 'group', 1 );
$scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery-form', 'suggest' ), '20090102' );
$scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery-form', 'suggest' ), '20090122' );
$scripts->add_data( 'inline-edit-post', 'group', 1 );
$scripts->localize( 'inline-edit-post', 'inlineEditL10n', array(
'error' => __('Error while saving the changes.'),