public
Description: The solution for tabitus of the browser
Homepage: http://overstimulate.com/projects/taboo
Clone URL: git://github.com/anotherjesse/taboo.git
fix an off by one error
anotherjesse (author)
Sat Jul 12 16:11:51 -0700 2008
commit  fb019a175eb462d40d8674e346df604ec56d2e8c
tree    d508b8e15db04ea1c0ce2011e5b1b8cc0976de5a
parent  743ec17a10391a81c558a022e563b36b3eae9496
...
205
206
207
 
208
209
210
211
212
213
214
215
216
 
217
218
219
220
 
221
 
222
223
224
...
227
228
229
230
 
231
232
233
234
235
 
236
237
238
...
205
206
207
208
209
210
211
212
 
 
 
213
214
215
216
217
218
 
219
220
221
222
223
224
...
227
228
229
 
230
231
232
233
234
235
236
237
238
239
0
@@ -205,20 +205,20 @@ function Taboo() {
0
       return;
0
     }
0
 
0
+ // lazy load tabs if more exist
0
     if (newIdx >= quickShowTabs.length) {
0
       if (quickShowEnum.hasMoreElements()) {
0
         addRow();
0
       }
0
- else {
0
- return;
0
- }
0
     }
0
 
0
+ // unhighlight the current selected tab
0
     quickShowTabs[quickShowIdx].removeAttribute('class');
0
 
0
     if (newIdx >= quickShowTabs.length) {
0
- newIdx = quickShowTabs.length -1;
0
+ newIdx = quickShowTabs.length - 1;
0
     }
0
+
0
     quickShowIdx = newIdx;
0
     quickShowTabs[quickShowIdx].setAttribute('class', 'current');
0
 
0
@@ -227,12 +227,13 @@ function Taboo() {
0
     }
0
 
0
     var topIdx = quickShowIdx - (displayRows * displayCols);
0
-
0
+ topIdx = topIdx - (Math.abs(topIdx) % displayCols);
0
     if (visible(topIdx)) {
0
       setVisibleFor(topIdx, false);
0
     }
0
 
0
     var bottomIdx = quickShowIdx + (displayRows * displayCols);
0
+ bottomIdx = bottomIdx - (Math.abs(bottomIdx) % displayCols);
0
     if (visible(bottomIdx)) {
0
       setVisibleFor(bottomIdx, false);
0
     }

Comments

    No one has commented yet.