Added enter keyboard action for grids

This commit is contained in:
Paulin Jorys 2017-05-23 17:41:03 +02:00
parent 8689032369
commit 8e601a9577
2 changed files with 10 additions and 3 deletions

View File

@ -105,10 +105,7 @@ main {
padding:25px; padding:25px;
} }
#backIcon { #backIcon {
width: 32px;
height: 24px;
position: fixed; position: fixed;
top: 16px;
left: 28px; left: 28px;
} }
#backIcon:hover { #backIcon:hover {

View File

@ -348,6 +348,11 @@ function addHostToGrid(host, ismDNSDiscovered) {
cell.click(function () { cell.click(function () {
hostChosen(host); hostChosen(host);
}); });
outerDiv.keypress(function(e){
if(e.keyCode == 13) {
hostChosen(host);
}
});
$(outerDiv).append(cell); $(outerDiv).append(cell);
if (!ismDNSDiscovered) { if (!ismDNSDiscovered) {
// we don't have the option to delete mDNS hosts. So don't show it to the user. // we don't have the option to delete mDNS hosts. So don't show it to the user.
@ -439,6 +444,11 @@ function showApps(host) {
$('#game-'+app.id).on('click', function () { $('#game-'+app.id).on('click', function () {
startGame(host, app.id); startGame(host, app.id);
}); });
$('#game-'+app.id).keypress(function(e){
if(e.keyCode == 13) {
startGame(host, app.id);
}
});
// apply CSS stylization to indicate whether the app is active // apply CSS stylization to indicate whether the app is active
stylizeBoxArt(host, app.id); stylizeBoxArt(host, app.id);