Ticket #19392: 19392.2.diff
File 19392.2.diff, 2.0 KB (added by , 11 years ago) |
---|
-
src/wp-admin/js/inline-edit-post.js
104 104 $('#ttle'+id).remove(); 105 105 }); 106 106 107 // enable autocomplete for tags 108 if ( 'post' == type ) { 109 // support multi taxonomies? 110 tax = 'post_tag'; 111 $('tr.inline-editor textarea[name="tax_input['+tax+']"]').suggest( ajaxurl + '?action=ajax-tag-search&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: inlineEditL10n.comma + ' ' } ); 112 } 107 //flat taxonomies 108 this.taxSuggest(); 109 113 110 $('html, body').animate( { scrollTop: 0 }, 'fast' ); 114 111 }, 115 112 … … 172 169 }); 173 170 174 171 //flat taxonomies 175 $('.tags_input', rowData).each(function(){ 176 var terms = $(this).text(), 177 taxname = $(this).attr('id').replace('_' + id, ''), 178 textarea = $('textarea.tax_input_' + taxname, editRow), 179 comma = inlineEditL10n.comma; 172 t.taxSuggest(); 180 173 181 if ( terms ) {182 if ( ',' !== comma )183 terms = terms.replace(/,/g, comma);184 textarea.val(terms);185 }186 187 textarea.suggest( ajaxurl + '?action=ajax-tag-search&tax=' + taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: inlineEditL10n.comma + ' ' } );188 });189 190 174 // handle the post status 191 175 status = $('._status', rowData).text(); 192 176 if ( 'future' != status ) … … 291 275 var id = $(o).closest('tr').attr('id'), 292 276 parts = id.split('-'); 293 277 return parts[parts.length - 1]; 278 }, 279 280 taxSuggest : function() { 281 $('.inline-edit-tags textarea').each( function() { 282 var terms = $(this).text(), 283 taxname = $(this).attr('class').replace('tax_input_', ''), 284 comma = inlineEditL10n.comma; 285 if ( terms ) { 286 if ( ',' !== comma ) 287 terms = terms.replace(/,/g, comma); 288 $(this).val(terms); 289 } 290 291 $(this).suggest( ajaxurl + '?action=ajax-tag-search&tax=' + taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: comma + ' ' } ); 292 }); 294 293 } 295 294 }; 296 295