Skip to content

Commit c3be876

Browse files
bsuraiMottie
authored andcommitted
issue #581
moving up from last right key in the Navigation extension. #581 #581
1 parent 47618be commit c3be876

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

js/jquery.keyboard.extension-navigation.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ $.fn.addNavigation = function(options){
155155
}
156156
indx = typeof indx === 'number' ? indx : o.position[1];
157157
row = typeof row === 'number' ? row : o.position[0];
158+
var nextRow = row;
158159
var kbcss = $.keyboard.css,
159160
vis = base.$keyboard.find('.' + kbcss.keySet + ':visible'),
160161
maxRow = vis.find('.' + kbcss.endRow).length - 1,
@@ -169,7 +170,12 @@ $.fn.addNavigation = function(options){
169170
case k.end : indx = maxIndx; break; // End
170171
case k.home : indx = 0; break; // Home
171172
case k.left : indx = base.leftNavigateKey(indx, maxIndx); break; // Left
172-
case k.up : row += (row > 0) ? -1 : 0; break; // Up
173+
case k.up :
174+
nextRow += (row > 0) ? -1 : 0;
175+
var nextMaxIndx = base.getMaxIndex(vis, kbcss.keyButton, nextRow);
176+
indx = indx === maxIndx ? nextMaxIndx : indx;
177+
row = nextRow;
178+
break; // Up
173179
case k.right : indx = base.rightNavigateKey(indx, maxIndx); break; // Right
174180
case k.down : row += (row + 1 > maxRow) ? 0 : 1; break; // Down
175181
case k.caretrt : p.start++; break; // caret right

0 commit comments

Comments
 (0)