Changeset 38227
- Timestamp:
- 08/09/2016 10:38:28 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/updates.js
r38221 r38227 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( { … … 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 … … 1169 1171 */ 1170 1172 wp.updates.deleteTheme = function( args ) { 1171 var $button = $( '.theme-actions .delete-theme' ); 1173 var $button; 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 } 1172 1180 1173 1181 args = _.extend( { … … 1176 1184 }, args ); 1177 1185 1178 if ( $button.html() !== wp.updates.l10n.deleting ) { 1179 $button.data( 'originaltext', $button.html() ); 1180 } 1181 1182 $button.text( wp.updates.l10n.deleting ); 1186 if ( $button && $button.html() !== wp.updates.l10n.deleting ) { 1187 $button 1188 .data( 'originaltext', $button.html() ) 1189 .text( wp.updates.l10n.deleting ); 1190 } 1191 1183 1192 wp.a11y.speak( wp.updates.l10n.deleting, 'polite' ); 1184 1193 … … 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;
Note: See TracChangeset
for help on using the changeset viewer.