]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/inline-edit-tax.dev.js
Wordpress 3.1.4-scripts
[autoinstalls/wordpress.git] / wp-admin / js / inline-edit-tax.dev.js
index 91c85ff81afee91e52ad6c976d62c06b02e0bd85..a6c228a7feda120bf7eb044a5b0e2a3abcf8d77d 100644 (file)
@@ -8,8 +8,10 @@ inlineEditTax = {
                t.type = $('#the-list').attr('className').substr(5);
                t.what = '#'+t.type+'-';
 
-               // get all editable rows
-               t.rows = $('tr.iedit');
+               $('.editinline').live('click', function(){
+                       inlineEditTax.edit(this);
+                       return false;
+               });
 
                // prepare the edit row
                row.keyup(function(e) { if(e.which == 27) return inlineEditTax.revert(); });
@@ -18,9 +20,6 @@ inlineEditTax = {
                $('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.addEvents(t.rows);
-
                $('#posts-filter input[type="submit"]').click(function(e){
                        if ( $('form#posts-filter tr.inline-editor').length > 0 )
                                t.revert();
@@ -32,12 +31,6 @@ inlineEditTax = {
                $(t.what+t.getId(el)).css('display') == 'none' ? t.revert() : t.edit(el);
        },
 
-       addEvents : function(r) {
-               r.each(function() {
-                       $(this).find('a.editinline').click(function() { inlineEditTax.edit(this); return false; });
-               });
-       },
-
        edit : function(id) {
                var t = this, editRow;
                t.revert();
@@ -77,7 +70,7 @@ inlineEditTax = {
                        taxonomy: tax
                };
 
-               fields = $('#edit-'+id+' :input').fieldSerialize();
+               fields = $('#edit-'+id+' :input').serialize();
                params = fields + '&' + $.param(params);
 
                // make ajax request
@@ -93,10 +86,7 @@ inlineEditTax = {
 
                                                $('#edit-'+id).before(r).remove();
                                                row = new_id ? $('#'+new_id) : $(inlineEditTax.what+id);
-                                               row.hide();
-
-                                               inlineEditTax.addEvents(row);
-                                               row.fadeIn();
+                                               row.hide().fadeIn();
                                        } else
                                                $('#edit-'+id+' .inline-edit-save .error').html(r).show();
                                } else