File tree 1 file changed +11
-13
lines changed
1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change 188
188
// page up: jump five items up, stopping at the top
189
189
// the number 5 is used so that we go one page in the
190
190
// inner-scrolled Dependencies and Versions fields
191
- switchTo = currentLink ;
192
- for ( var n = 0 ; n < 5 && switchTo ; ++ n ) {
193
- switchTo = previous ( allItems , switchTo ) ;
194
- }
195
- if ( ! switchTo ) {
196
- switchTo = allItems [ 0 ] ;
191
+ switchTo = currentItem || allItems [ 0 ] ;
192
+ for ( var n = 0 ; n < 5 ; ++ n ) {
193
+ if ( switchTo . previousElementSibling && switchTo . previousElementSibling . className == 'pure-menu-item' ) {
194
+ switchTo = switchTo . previousElementSibling ;
195
+ }
197
196
}
198
197
break ;
199
198
case "pagedown" :
200
199
// page down: jump five items down, stopping at the bottom
201
200
// the number 5 is used so that we go one page in the
202
- // inner-scrolled Depedencies and Versions fields
203
- switchTo = currentLink ;
204
- for ( var n = 0 ; n < 5 && switchTo ; ++ n ) {
205
- switchTo = next ( allItems , switchTo ) ;
206
- }
207
- if ( ! switchTo ) {
208
- switchTo = last ( allItems ) ;
201
+ // inner-scrolled Dependencies and Versions fields
202
+ switchTo = currentItem || last ( allItems ) ;
203
+ for ( var n = 0 ; n < 5 ; ++ n ) {
204
+ if ( switchTo . nextElementSibling && switchTo . nextElementSibling . className == 'pure-menu-item' ) {
205
+ switchTo = switchTo . nextElementSibling ;
206
+ }
209
207
}
210
208
break ;
211
209
}
You can’t perform that action at this time.
0 commit comments