From 9008030f1e5d084476d22381854721b8d3a6f2cb Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Wed, 29 Jun 2016 13:30:00 +0000 Subject: [PATCH] List tables: Make the pagination links and text better responsive. On small screens, especially with longer translations, the pagination links and text could break in two lines. This fixes it moving down the text in a new line. Fixes #33962. git-svn-id: https://develop.svn.wordpress.org/trunk@37912 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/list-tables.css | 12 ++++++++++++ src/wp-admin/includes/class-wp-list-table.php | 6 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/css/list-tables.css b/src/wp-admin/css/list-tables.css index 15cfe2d8a6..8443a72416 100644 --- a/src/wp-admin/css/list-tables.css +++ b/src/wp-admin/css/list-tables.css @@ -2152,3 +2152,15 @@ div.action-links, width: 100%; } } + +@media screen and ( max-width: 480px ) { + .tablenav-pages .current-page { + margin: 0; + } + + .tablenav-pages .tablenav-paging-text { + float: left; + width: 100%; + padding-top: 0.5em; + } +} diff --git a/src/wp-admin/includes/class-wp-list-table.php b/src/wp-admin/includes/class-wp-list-table.php index d197a6a40d..0347919988 100644 --- a/src/wp-admin/includes/class-wp-list-table.php +++ b/src/wp-admin/includes/class-wp-list-table.php @@ -772,7 +772,7 @@ class WP_List_Table { $page_links = array(); $total_pages_before = ''; - $total_pages_after = ''; + $total_pages_after = ''; $disable_first = $disable_last = $disable_prev = $disable_next = false; @@ -813,9 +813,9 @@ class WP_List_Table { if ( 'bottom' === $which ) { $html_current_page = $current; - $total_pages_before = '' . __( 'Current Page' ) . ''; + $total_pages_before = '' . __( 'Current Page' ) . ''; } else { - $html_current_page = sprintf( "%s", + $html_current_page = sprintf( "%s", '', $current, strlen( $total_pages )