Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
Shorten the .update-link click handler and improve it's inline comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
pbiron committed May 6, 2020
1 parent 8b75528 commit 82e1800
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions js/wp-autoupdates.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,14 @@
} );

/**
* When manually updating a plugin the 'time until next update' text needs to be hidden.
* When manually updating a plugin/theme the 'time until next update' text needs to be cleared.
*
* TODO: fire this off an event that wp-admin/js/updates.js triggers when the update is complete.
* TODO: fire this off an event that wp-admin/js/updates.js triggers when the update succeeds.
*/
$( '.update-link' ).click( function() {
var plugin = $( this ).closest( 'tr' ).attr( 'data-plugin' ),
$plugin_row = $( 'tr.update[data-plugin="' + plugin + '"]' );
var plugin = $( this ).closest( 'tr' ).attr( 'data-plugin' );

$plugin_row.find( '.auto-update-time' ).empty();
$( 'tr.update[data-plugin="' + plugin + '"]' ).find( '.auto-update-time' ).empty();
} );
} );
} )( jQuery, window._wpUpdatesSettings, window.pagenow );

0 comments on commit 82e1800

Please sign in to comment.