summaryrefslogtreecommitdiffstats
path: root/application/modules/fbgui/views
diff options
context:
space:
mode:
authorSimon2011-04-14 14:40:07 +0200
committerSimon2011-04-14 14:40:07 +0200
commitddb047e19c5f44c37888fd726153d0188010a7dc (patch)
tree9c2ed9c8bc9ffed7aceaa0f49911523fca0ad4f0 /application/modules/fbgui/views
parentTicket #209 - Erster Eintrag wird selektiert und mit Enter gehts weiter (diff)
downloadpbs2-ddb047e19c5f44c37888fd726153d0188010a7dc.tar.gz
pbs2-ddb047e19c5f44c37888fd726153d0188010a7dc.tar.xz
pbs2-ddb047e19c5f44c37888fd726153d0188010a7dc.zip
Ticket #210 - Menueinträge mit Pfeiltasten navigierbar
Diffstat (limited to 'application/modules/fbgui/views')
-rw-r--r--application/modules/fbgui/views/scripts/index/index.phtml25
1 files changed, 24 insertions, 1 deletions
diff --git a/application/modules/fbgui/views/scripts/index/index.phtml b/application/modules/fbgui/views/scripts/index/index.phtml
index 0c98c2f..f12e93c 100644
--- a/application/modules/fbgui/views/scripts/index/index.phtml
+++ b/application/modules/fbgui/views/scripts/index/index.phtml
@@ -1,5 +1,6 @@
<?php if(isset($this->entries)):?>
<script type="text/javascript">
+ var activeElement = 0;
$(document).ready(function(){
$('.menu').click(function(){
$('.menu').removeClass('selected');
@@ -7,7 +8,7 @@
$("#selectedBootOs").val($(this).find('.id').val());
$("#startball").attr('src','/media/img/button-green.png');
});
- $('.menu').eq('0').click();
+ $('.menu').eq(activeElement).click();
$('#startbutton').focus();
$('.menu').dblclick(function(){
$('.menu').removeClass('selected');
@@ -16,6 +17,28 @@
$("#startball").attr('src','/media/img/button-green.png');
start();
});
+
+ $(function() {
+ $(document).keyup(function (event) {
+ //console.log(activeElement);
+ if (event.keyCode == 38) {
+ // up
+ if(activeElement >=1)
+ activeElement = activeElement-1;
+ $('.menu').eq(activeElement).click();
+ $('#startbutton').focus();
+
+ } else if (event.keyCode == 40) {
+ // Down
+ if(activeElement < $('.menu').length-1 )
+ activeElement = activeElement+1;
+ $('.menu').eq(activeElement).click();
+ $('#startbutton').focus();
+ }
+ //console.log(activeElement);
+ });
+ });
+
});
function start(){
if($('#selectedBootOs').val() != ''){