Pager: remove selected attribute from page options. See #700

This commit is contained in:
Mottie 2014-07-31 07:42:21 -05:00
parent 94fd41758c
commit bb939266a8
6 changed files with 9 additions and 5 deletions

View File

@ -842,6 +842,8 @@
// page size selector
p.$size = pager.find(p.cssPageSize);
if ( p.$size.length ) {
// setting an option as selected appears to cause issues with initial page size
p.$size.find('option').removeAttr('selected');
p.$size.unbind('change.pager').bind('change.pager', function() {
p.$size.val( $(this).val() ); // in case there are more than one pagers
if ( !$(this).hasClass(p.cssDisabled) ) {

View File

@ -153,7 +153,7 @@
<img src="../addons/pager/icons/next.png" class="next" alt="Next" title="Next page" />
<img src="../addons/pager/icons/last.png" class="last" alt="Last" title= "Last page" />
<select class="pagesize">
<option selected="selected" value="10">10</option>
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
@ -444,7 +444,7 @@
<img src="../addons/pager/icons/next.png" class="next" alt="Next" title="Next page" />
<img src="../addons/pager/icons/last.png" class="last" alt="Last" title= "Last page" />
<select class="pagesize">
<option selected="selected" value="10">10</option>
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>

View File

@ -588,7 +588,7 @@ td.tablesorter-pager {
&lt;img src=&quot;next.png&quot; class=&quot;next&quot;/&gt;
&lt;img src=&quot;last.png&quot; class=&quot;last&quot;/&gt;
&lt;select class=&quot;pagesize&quot;&gt;
&lt;option selected=&quot;selected&quot; value=&quot;10&quot;&gt;10&lt;/option&gt;
&lt;option value=&quot;10&quot;&gt;10&lt;/option&gt;
&lt;option value=&quot;20&quot;&gt;20&lt;/option&gt;
&lt;option value=&quot;30&quot;&gt;30&lt;/option&gt;
&lt;option value=&quot;40&quot;&gt;40&lt;/option&gt;

View File

@ -625,7 +625,7 @@ td.tablesorter-pager {
&lt;img src=&quot;next.png&quot; class=&quot;next&quot;/&gt;
&lt;img src=&quot;last.png&quot; class=&quot;last&quot;/&gt;
&lt;select class=&quot;pagesize&quot;&gt;
&lt;option selected=&quot;selected&quot; value=&quot;10&quot;&gt;10&lt;/option&gt;
&lt;option value=&quot;10&quot;&gt;10&lt;/option&gt;
&lt;option value=&quot;20&quot;&gt;20&lt;/option&gt;
&lt;option value=&quot;30&quot;&gt;30&lt;/option&gt;
&lt;option value=&quot;40&quot;&gt;40&lt;/option&gt;

View File

@ -3131,7 +3131,7 @@ $.extend($.tablesorter.themes.jui, {
&lt;img src=&quot;next.png&quot; class=&quot;next&quot;/&gt;
&lt;img src=&quot;last.png&quot; class=&quot;last&quot;/&gt;
&lt;select class=&quot;pagesize&quot;&gt;
&lt;option selected=&quot;selected&quot; value=&quot;10&quot;&gt;10&lt;/option&gt;
&lt;option value=&quot;10&quot;&gt;10&lt;/option&gt;
&lt;option value=&quot;20&quot;&gt;20&lt;/option&gt;
&lt;option value=&quot;30&quot;&gt;30&lt;/option&gt;
&lt;option value=&quot;40&quot;&gt;40&lt;/option&gt;

View File

@ -306,6 +306,8 @@ tsp = ts.pager = {
}
if ( p.$size.length ) {
// setting an option as selected appears to cause issues with initial page size
p.$size.find('option').removeAttr('selected');
p.$size
.unbind('change.pager')
.bind('change.pager', function() {