Ticket #37603: 37603.5.diff
File 37603.5.diff, 2.9 KB (added by , 8 years ago) |
---|
-
src/wp-admin/js/updates.js
716 716 * decorated with an abort() method. 717 717 */ 718 718 wp.updates.deletePlugin = function( args ) { 719 var $ message = $( '[data-plugin="' + args.plugin + '"]' ).find( '.update-message p' );719 var $link = $( '[data-plugin="' + args.plugin + '"]' ).find( '.row-actions a.delete' ); 720 720 721 721 args = _.extend( { 722 722 success: wp.updates.deletePluginSuccess, 723 723 error: wp.updates.deletePluginError 724 724 }, args ); 725 725 726 if ( $message.html() !== wp.updates.l10n.updating ) { 727 $message.data( 'originaltext', $message.html() ); 726 if ( $link.html() !== wp.updates.l10n.deleting ) { 727 $link 728 .data( 'originaltext', $link.html() ) 729 .text( wp.updates.l10n.deleting ) 728 730 } 729 731 730 732 wp.a11y.speak( wp.updates.l10n.deleting, 'polite' ); … … 1168 1170 * decorated with an abort() method. 1169 1171 */ 1170 1172 wp.updates.deleteTheme = function( args ) { 1171 var $button = $( '.theme-actions .delete-theme' );1173 var $button; 1172 1174 1175 if ( 'themes' === pagenow ) { 1176 $button = $( '.theme-actions .delete-theme' ) 1177 } else if ( 'themes-network' === pagenow ) { 1178 $button = $( '[data-slug="' + args.slug + '"]' ).find( '.row-actions a.delete' ); 1179 } 1180 1173 1181 args = _.extend( { 1174 1182 success: wp.updates.deleteThemeSuccess, 1175 1183 error: wp.updates.deleteThemeError 1176 1184 }, args ); 1177 1185 1178 1186 if ( $button.html() !== wp.updates.l10n.deleting ) { 1179 $button.data( 'originaltext', $button.html() ); 1187 $button 1188 .data( 'originaltext', $button.html() ) 1189 .text( wp.updates.l10n.deleting ); 1180 1190 } 1181 1191 1182 $button.text( wp.updates.l10n.deleting );1183 1192 wp.a11y.speak( wp.updates.l10n.deleting, 'polite' ); 1184 1193 1185 1194 // Remove previous error messages, if any. … … 1710 1719 if ( 'import' === pagenow ) { 1711 1720 $updatingMessage.removeClass( 'updating-message' ); 1712 1721 } else if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) { 1713 $message = $( 'tr[data-plugin="' + job.data.plugin + '"]' ).find( '.update-message' ); 1722 if ( 'update-plugin' === job.action ) { 1723 $message = $( 'tr[data-plugin="' + job.data.plugin + '"]' ).find( '.update-message' ); 1724 } else if ( 'delete-plugin' === job.action ) { 1725 $message = $( '[data-plugin="' + job.data.plugin + '"]' ).find( '.row-actions a.delete' ); 1726 } 1727 } else if ( 'themes' === pagenow || 'themes-network' === pagenow ) { 1728 if ( 'update-theme' === job.action ) { 1729 $message = $( '[data-slug="' + job.data.slug + '"]' ).find( '.update-message' ); 1730 } else if ( 'delete-theme' === job.action && 'themes-network' === pagenow ) { 1731 $message = $( '[data-slug="' + job.data.slug + '"]' ).find( '.row-actions a.delete' ); 1732 } else if ( 'delete-theme' === job.action && 'themes' === pagenow ) { 1733 $message = $( '.theme-actions .delete-theme' ); 1734 } 1714 1735 } else { 1715 1736 $message = $updatingMessage; 1716 1737 }