<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[17202] trunk/wp-admin: Disabled states for first/prev and next/
 last pagination buttons when they should noop.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/17202">17202</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2011-01-01 23:19:26 +0000 (Sat, 01 Jan 2011)</dd>
</dl>

<h3>Log Message</h3>
<pre>Disabled states for first/prev and next/last pagination buttons when they should noop. see <a href="http://trac.wordpress.org/ticket/15503">#15503</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmincsscolorsclassicdevcss">trunk/wp-admin/css/colors-classic.dev.css</a></li>
<li><a href="#trunkwpadmincsscolorsfreshdevcss">trunk/wp-admin/css/colors-fresh.dev.css</a></li>
<li><a href="#trunkwpadmincsswpadmindevcss">trunk/wp-admin/css/wp-admin.dev.css</a></li>
<li><a href="#trunkwpadminincludesclasswplisttablephp">trunk/wp-admin/includes/class-wp-list-table.php</a></li>
<li><a href="#trunkwpadminjslisttabledevjs">trunk/wp-admin/js/list-table.dev.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmincsscolorsclassicdevcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/colors-classic.dev.css (17201 => 17202)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/colors-classic.dev.css        2011-01-01 22:30:46 UTC (rev 17201)
+++ trunk/wp-admin/css/colors-classic.dev.css        2011-01-01 23:19:26 UTC (rev 17202)
</span><span class="lines">@@ -1400,17 +1400,19 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .tablenav .tablenav-pages a {
</span><del>-        border-color: #D1E5EE;
</del><ins>+        border-color: #d1e5ee;
</ins><span class="cx">         background: #eee url('../images/menu-bits-vs.gif?ver=20101102') repeat-x scroll left -379px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.tablenav .tablenav-pages a:hover {
</del><ins>+.tablenav .tablenav-pages a:hover,
+.tablenav .tablenav-pages a:focus {
</ins><span class="cx">         color: #d54e21;
</span><del>-        border-color: #d54321;
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-.tablenav .tablenav-pages a:active {
-        color: #fff !important;
</del><ins>+.tablenav .tablenav-pages a.disabled,
+.tablenav .tablenav-pages a.disabled:hover,
+.tablenav .tablenav-pages a.disabled:focus {
+        color: #aaa;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .tablenav .tablenav-pages .current {
</span></span></pre></div>
<a id="trunkwpadmincsscolorsfreshdevcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/colors-fresh.dev.css (17201 => 17202)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/colors-fresh.dev.css        2011-01-01 22:30:46 UTC (rev 17201)
+++ trunk/wp-admin/css/colors-fresh.dev.css        2011-01-01 23:19:26 UTC (rev 17202)
</span><span class="lines">@@ -1399,13 +1399,15 @@
</span><span class="cx">         background: #eee url('../images/menu-bits.gif?ver=20100610') repeat-x scroll left -379px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.tablenav .tablenav-pages a:hover {
</del><ins>+.tablenav .tablenav-pages a:hover,
+.tablenav .tablenav-pages a:focus {
</ins><span class="cx">         color: #d54e21;
</span><del>-        border-color: #d54321;
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-.tablenav .tablenav-pages a:active {
-        color: #fff !important;
</del><ins>+.tablenav .tablenav-pages a.disabled,
+.tablenav .tablenav-pages a.disabled:hover,
+.tablenav .tablenav-pages a.disabled:focus {
+        color: #aaa;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .tablenav .tablenav-pages .current {
</span></span></pre></div>
<a id="trunkwpadmincsswpadmindevcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/wp-admin.dev.css (17201 => 17202)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/wp-admin.dev.css        2011-01-01 22:30:46 UTC (rev 17201)
+++ trunk/wp-admin/css/wp-admin.dev.css        2011-01-01 23:19:26 UTC (rev 17202)
</span><span class="lines">@@ -1493,6 +1493,14 @@
</span><span class="cx">         border-radius: 5px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.tablenav .tablenav-pages a.disabled:hover {
+        cursor: default;
+}
+
+.tablenav .tablenav-pages a.disabled:active {
+        cursor: default;
+}
+
</ins><span class="cx"> .tablenav .displaying-num {
</span><span class="cx">         margin-right: 10px;
</span><span class="cx">         font-size: 12px;
</span></span></pre></div>
<a id="trunkwpadminincludesclasswplisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-list-table.php (17201 => 17202)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-list-table.php        2011-01-01 22:30:46 UTC (rev 17201)
+++ trunk/wp-admin/includes/class-wp-list-table.php        2011-01-01 23:19:26 UTC (rev 17202)
</span><span class="lines">@@ -480,15 +480,21 @@
</span><span class="cx"> 
</span><span class="cx">                 $page_links = array();
</span><span class="cx"> 
</span><ins>+                $disable_first = $disable_last = '';
+                if ( $current == 1 )
+                        $disable_first = ' disabled';
+                if ( $current == $total_items )
+                        $disable_last = ' disabled';
+
</ins><span class="cx">                 $page_links[] = sprintf( &quot;&lt;a class='%s' title='%s' href='%s'&gt;%s&lt;/a&gt;&quot;,
</span><del>-                        'first-page',
</del><ins>+                        'first-page' . $disable_first,
</ins><span class="cx">                         esc_attr__( 'Go to the first page' ),
</span><span class="cx">                         esc_url( remove_query_arg( 'paged', $current_url ) ),
</span><span class="cx">                         '&amp;laquo;'
</span><span class="cx">                 );
</span><span class="cx"> 
</span><span class="cx">                 $page_links[] = sprintf( &quot;&lt;a class='%s' title='%s' href='%s'&gt;%s&lt;/a&gt;&quot;,
</span><del>-                        'prev-page',
</del><ins>+                        'prev-page' . $disable_first,
</ins><span class="cx">                         esc_attr__( 'Go to the previous page' ),
</span><span class="cx">                         esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ),
</span><span class="cx">                         '&amp;lsaquo;'
</span><span class="lines">@@ -504,14 +510,14 @@
</span><span class="cx">                 $page_links[] = '&lt;span class=&quot;paging-input&quot;&gt;' . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . '&lt;/span&gt;';
</span><span class="cx"> 
</span><span class="cx">                 $page_links[] = sprintf( &quot;&lt;a class='%s' title='%s' href='%s'&gt;%s&lt;/a&gt;&quot;,
</span><del>-                        'next-page',
</del><ins>+                        'next-page' . $disable_last,
</ins><span class="cx">                         esc_attr__( 'Go to the next page' ),
</span><span class="cx">                         esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ),
</span><span class="cx">                         '&amp;rsaquo;'
</span><span class="cx">                 );
</span><span class="cx"> 
</span><span class="cx">                 $page_links[] = sprintf( &quot;&lt;a class='%s' title='%s' href='%s'&gt;%s&lt;/a&gt;&quot;,
</span><del>-                        'last-page',
</del><ins>+                        'last-page' . $disable_last,
</ins><span class="cx">                         esc_attr__( 'Go to the last page' ),
</span><span class="cx">                         esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
</span><span class="cx">                         '&amp;raquo;'
</span></span></pre></div>
<a id="trunkwpadminjslisttabledevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/list-table.dev.js (17201 => 17202)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/list-table.dev.js        2011-01-01 22:30:46 UTC (rev 17201)
+++ trunk/wp-admin/js/list-table.dev.js        2011-01-01 23:19:26 UTC (rev 17202)
</span><span class="lines">@@ -91,6 +91,8 @@
</span><span class="cx">                 if ( 'object' != typeof response ) {
</span><span class="cx">                         this.handle_error();
</span><span class="cx">                 } else {
</span><ins>+                        var tablenav = $('.tablenav-pages');
+
</ins><span class="cx">                         this.stop_loading();
</span><span class="cx"> 
</span><span class="cx">                         $('div.updated, div.error').not('.persistent, .inline').remove();
</span><span class="lines">@@ -103,10 +105,14 @@
</span><span class="cx">                         this.set_total_pages(response.total_pages);
</span><span class="cx"> 
</span><span class="cx">                         if ( response.total_pages &gt; 1 )
</span><del>-                                $('.tablenav-pages').removeClass('one-page');
</del><ins>+                                tablenav.removeClass('one-page');
</ins><span class="cx"> 
</span><span class="cx">                         $('.current-page').val($.query.GET('paged'));
</span><span class="cx"> 
</span><ins>+                        // Disable buttons that should noop.
+                        tablenav.find('.first-page, .prev-page').toggleClass('disabled', 1 == $.query.GET('paged'));
+                        tablenav.find('.next-page, .last-page').toggleClass('disabled', response.total_pages_i18n == $.query.GET('paged'));
+
</ins><span class="cx">                         $('th.column-cb :input').attr('checked', false);
</span><span class="cx"> 
</span><span class="cx">                         if ( history.replaceState ) {
</span></span></pre>
</div>
</div>

</body>
</html>