projects
/
bookreader.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ad712ba
)
Created a setting for the number of out-of-view rows buffered for thumbnails
author
scollett
<stephanie.collett@ucop.edu>
Tue, 17 Nov 2009 00:10:41 +0000
(16:10 -0800)
committer
scollett
<stephanie.collett@ucop.edu>
Tue, 17 Nov 2009 00:10:41 +0000
(16:10 -0800)
GnuBook/GnuBook.js
patch
|
blob
|
history
diff --git
a/GnuBook/GnuBook.js
b/GnuBook/GnuBook.js
index
8b4714f
..
64bffee
100644
(file)
--- a/
GnuBook/GnuBook.js
+++ b/
GnuBook/GnuBook.js
@@
-41,6
+41,7
@@
function GnuBook() {
this.mode = 1; //1, 2, 3
this.ui = 'full'; // UI mode
this.thumbScale = 10; // thumbnail default
this.mode = 1; //1, 2, 3
this.ui = 'full'; // UI mode
this.thumbScale = 10; // thumbnail default
+ this.thumbRowBuffer = 4; // number of rows to pre-cache out a view
this.displayedIndices = [];
this.displayedRows=[];
this.displayedIndices = [];
this.displayedRows=[];
@@
-633,8
+634,7
@@
GnuBook.prototype.drawLeafsThumbnail = function() {
var firstRow = rowsToDisplay[0];
var lastRow = rowsToDisplay[rowsToDisplay.length-1];
var firstRow = rowsToDisplay[0];
var lastRow = rowsToDisplay[rowsToDisplay.length-1];
- var rowBuffer = 4;
- for (i=1; i<rowBuffer+1; i++) {
+ for (i=1; i<this.thumbRowBuffer+1; i++) {
if (firstRow-i >= 0) { rowsToDisplay.unshift(firstRow-i); }
if (lastRow+i < leafMap.length) { rowsToDisplay.push(lastRow+i); }
}
if (firstRow-i >= 0) { rowsToDisplay.unshift(firstRow-i); }
if (lastRow+i < leafMap.length) { rowsToDisplay.push(lastRow+i); }
}