up and down keys for navigation
This commit is contained in:
parent
9ce083275b
commit
64d262ff77
|
@ -80,6 +80,17 @@ $(function() {
|
|||
}, "json");
|
||||
});
|
||||
|
||||
$(document).keydown(function(e) {
|
||||
var k = e.keyCode;
|
||||
if (k==40) {
|
||||
e.preventDefault();
|
||||
moveListDown();
|
||||
}
|
||||
if (k==38) {
|
||||
e.preventDefault();
|
||||
moveListUp();
|
||||
}
|
||||
});
|
||||
|
||||
$(window).resize(function() {
|
||||
var minuser = 400;
|
||||
|
@ -179,3 +190,19 @@ function getSelectedIds() {
|
|||
});
|
||||
return ids;
|
||||
}
|
||||
|
||||
function moveListDown() {
|
||||
var currentIndex = $('.selectedItem').index(".fileItem");
|
||||
if (currentIndex == $('.fileItem').length) {
|
||||
return;
|
||||
}
|
||||
$('.fileItem').eq(currentIndex + 1).click();
|
||||
}
|
||||
|
||||
function moveListUp() {
|
||||
var currentIndex = $('.selectedItem').index(".fileItem");
|
||||
if (currentIndex == 0) {
|
||||
return;
|
||||
}
|
||||
$('.fileItem').eq(currentIndex - 1).click();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user