Skip to content

Commit

Permalink
Upgrade/Install: Update 'show details' button change.
Browse files Browse the repository at this point in the history
Add a up/down arrow for visual affordance about the purpose of the button link; change button text from "Show details" to "More details".

Props krupajnanda, subrataemfluence, audrasjb, afercia, nrqsnchz, joedolson.
Fixes #44714.

git-svn-id: https://develop.svn.wordpress.org/trunk@56027 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
joedolson committed Jun 25, 2023
1 parent c5a7371 commit 3381afd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/wp-admin/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,14 @@ code {
margin-left: 0;
}

.js-update-details-toggle .dashicons {
text-decoration: none;
}

.js-update-details-toggle[aria-expanded="true"] .dashicons::before {
content: "\f142";
}

.no-js .widefat thead .check-column input,
.no-js .widefat tfoot .check-column input {
display: none;
Expand Down
4 changes: 2 additions & 2 deletions src/wp-admin/includes/class-bulk-upgrader-skin.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function before( $title = '' ) {
$this->in_loop = true;
printf( '<h2>' . $this->upgrader->strings['skin_before_update_header'] . ' <span class="spinner waiting-' . $this->upgrader->update_current . '"></span></h2>', $title, $this->upgrader->update_current, $this->upgrader->update_count );
echo '<script type="text/javascript">jQuery(\'.waiting-' . esc_js( $this->upgrader->update_current ) . '\').css("display", "inline-block");</script>';
// This progress messages div gets moved via JavaScript when clicking on "Show details.".
// This progress messages div gets moved via JavaScript when clicking on "More details.".
echo '<div class="update-messages hide-if-js" id="progress-' . esc_attr( $this->upgrader->update_current ) . '"><p>';
$this->flush_output();
}
Expand All @@ -154,7 +154,7 @@ public function after( $title = '' ) {
if ( ! $this->error ) {
echo '<div class="updated js-update-details" data-update-details="progress-' . esc_attr( $this->upgrader->update_current ) . '">' .
'<p>' . sprintf( $this->upgrader->strings['skin_update_successful'], $title ) .
' <button type="button" class="hide-if-no-js button-link js-update-details-toggle" aria-expanded="false">' . __( 'Show details.' ) . '</button>' .
' <button type="button" class="hide-if-no-js button-link js-update-details-toggle" aria-expanded="false">' . __( 'More details.' ) . '<span class="dashicons dashicons-arrow-down" aria-hidden="true"></span></button>' .
'</p></div>';
}

Expand Down

0 comments on commit 3381afd

Please sign in to comment.