projects
/
pazpar2-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d716fe1
)
Pager will now show only a fixed window of pages.
author
Jakub Skoczen
<jakub@indexdata.dk>
Mon, 2 Apr 2007 09:44:34 +0000
(09:44 +0000)
committer
Jakub Skoczen
<jakub@indexdata.dk>
Mon, 2 Apr 2007 09:44:34 +0000
(09:44 +0000)
www/masterkey/js/client.js
patch
|
blob
|
history
diff --git
a/www/masterkey/js/client.js
b/www/masterkey/js/client.js
index
94c2193
..
f70d98c
100644
(file)
--- a/
www/masterkey/js/client.js
+++ b/
www/masterkey/js/client.js
@@
-1,5
+1,5
@@
/*
/*
-** $Id: client.js,v 1.8 2007-04-02 08:41:51 jakub Exp $
+** $Id: client.js,v 1.9 2007-04-02 09:44:34 jakub Exp $
** MasterKey - pazpar2's javascript client .
*/
** MasterKey - pazpar2's javascript client .
*/
@@
-365,8
+365,13
@@
function drawPager(max, hits)
pager.append('<a class="previous_inactive">Previous</a>');
var numPages = Math.ceil(max / currentResultsPerPage);
pager.append('<a class="previous_inactive">Previous</a>');
var numPages = Math.ceil(max / currentResultsPerPage);
+
+ var start = ( currentPage - 5 > 0 ? currentPage - 5 : 1 );
+ var stop = ( start + 12 < numPages ? start + 12 : numPages );
+
+ if (start > 1) $('<span>... </span>').appendTo(pager);
- for(var i = 1; i <= numPages; i++)
+ for(var i = start; i <= stop; i++)
{
if( i == (currentPage + 1) ){
$('<a class="select">'+i+'</a>').appendTo(pager);
{
if( i == (currentPage + 1) ){
$('<a class="select">'+i+'</a>').appendTo(pager);
@@
-390,6
+395,8
@@
function drawPager(max, hits)
pager.eq(1).append(plClone);
}
pager.eq(1).append(plClone);
}
+ if (stop < numPages) $('<span> ...</span>').appendTo(pager);
+
if ( currentPage < (numPages-1) ){
$('<a class="next_active">Next</a>').click(function() { my_paz.showNext(1); currentPage++; }).appendTo(pager.eq(0));
$('<a class="next_active">Next</a>').click(function() { my_paz.showNext(1); currentPage++; }).appendTo(pager.eq(1));
if ( currentPage < (numPages-1) ){
$('<a class="next_active">Next</a>').click(function() { my_paz.showNext(1); currentPage++; }).appendTo(pager.eq(0));
$('<a class="next_active">Next</a>').click(function() { my_paz.showNext(1); currentPage++; }).appendTo(pager.eq(1));