Index: branches/1.0.x/elements/sorting.elm.tpl =================================================================== diff -u -N -r14864 -r14890 --- branches/1.0.x/elements/sorting.elm.tpl (.../sorting.elm.tpl) (revision 14864) +++ branches/1.0.x/elements/sorting.elm.tpl (.../sorting.elm.tpl) (revision 14890) @@ -1,27 +1,24 @@
+
+   + Products + - - + + - - + + + out of   + +
- - - out of   - -
- -
Sort by: @@ -88,26 +85,24 @@ } ); - - $('#paginate').change( - function () { - ListManager.setParam('page', $(this).val(), true); - } - ); + $('#paginate').change( + function () { + ListManager.setParam('page', $(this).val(), true); + } + ); - $('.prev, .next', '.paginate').click( - function ($e) { - var $option = $('option:selected', '#paginate')[ $(this).attr('class') ](); + $('.prev, .next', '.paginate').click( + function ($e) { + var $option = $('option:selected', '#paginate')[ $(this).attr('class') ](); - if ( $option.length ) { - $('#paginate').val( $option.attr('value') ).change(); - } - - return false; + if ( $option.length ) { + $('#paginate').val( $option.attr('value') ).change(); } - ); - + return false; + } + ); + $('#sorting').change( function ($e) { ListManager.setParam('sort_by', $(this).val().replace('|', ','), true); @@ -116,7 +111,13 @@ $('#per-page').change( function ($e) { - ListManager.setParam('per_page', $(this).val(), true); + var $per_page = $(this).val(); + + if ( $per_page == -1 ) { + ListManager.setParam('page', ''); + } + + ListManager.setParam('per_page', $per_page, true); } );