]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/inline-edit-tax.js
Wordpress 4.6-scripts
[autoinstalls/wordpress.git] / wp-admin / js / inline-edit-tax.js
index a05dc0954fa7b9863e4b1c9217e4460b1366fd43..3bbf4fb72ed8ed4c333108bcfb42d2e0ebfc11d6 100644 (file)
@@ -55,7 +55,7 @@ inlineEditTax = {
                }
 
                editRow = $('#inline-edit').clone(true), rowData = $('#inline_'+id);
-               $( 'td', editRow ).attr( 'colspan', $( 'th:visible, td:visible', '.widefat:first thead' ).length );
+               $( 'td', editRow ).attr( 'colspan', $( 'th:visible, td:visible', '.wp-list-table.widefat:first thead' ).length );
 
                $(t.what+id).hide().after(editRow).after('<tr class="hidden"></tr>');
 
@@ -121,8 +121,8 @@ inlineEditTax = {
                                                $( '#parent' ).find( 'option[value=' + option_value + ']' ).text( row.find( '.row-title' ).text() );
 
                                                row.hide().fadeIn( 400, function() {
-                                                       // Move focus back to the taxonomy title.
-                                                       row.find( '.row-title' ).focus();
+                                                       // Move focus back to the Quick Edit link.
+                                                       row.find( '.editinline' ).focus();
                                                        wp.a11y.speak( inlineEditL10n.saved );
                                                });
 
@@ -137,6 +137,8 @@ inlineEditTax = {
                                }
                        }
                );
+               // Prevent submitting the form when pressing Enter on a focused field.
+               return false;
        },
 
        revert : function() {
@@ -146,8 +148,8 @@ inlineEditTax = {
                        $( 'table.widefat .spinner' ).removeClass( 'is-active' );
                        $('#'+id).siblings('tr.hidden').addBack().remove();
                        id = id.substr( id.lastIndexOf('-') + 1 );
-                       // Show the taxonomy listing and move focus back to the taxonomy title.
-                       $( this.what + id ).show().find( '.row-title' ).focus();
+                       // Show the taxonomy row and move focus back to the Quick Edit link.
+                       $( this.what + id ).show().find( '.editinline' ).focus();
                }
        },