Skip to content

Commit

Permalink
EPG fixes for Fire TV.
Browse files Browse the repository at this point in the history
  • Loading branch information
Isabelle authored and Isabelle committed Oct 25, 2015
1 parent 0b86731 commit 399e3e1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 26 deletions.
35 changes: 10 additions & 25 deletions src/epg-firetv.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,20 @@ var searchBackward = function() {
document.getElementById('searchBackwardBtn').click();
};

function programKey(event) {
if (event.keyCode == 13) { // enter
if (menuOpen) {
setTimeout(function() {
var menuItem = document.getElementById('menu-details');
var ulElem = menuItem.parentElement.parentElement;
var items = ulElem.querySelectorAll('li > a').length;
jsHandler.setMenuItems(items);
menuItem.focus();
}, 0);
}
}
}

document.addEventListener('DOMContentLoaded', function(event) {
document.getElementById('calendarBtn').focus();
});

document.addEventListener('epgAction', function(event) {
if (event.detail == 'open.menu') {
setTimeout(function() {
var menuItem = document.getElementById('menu-details');
var ulElem = menuItem.parentElement.parentElement;
var items = ulElem.querySelectorAll('li > a').length;
jsHandler.setMenuItems(items);
menuItem.focus();
}, 0);
}
// if (event.detail == 'calendar') {
// setTimeout(function() {
// document.getElementById('calendarBtn').focus();
Expand Down Expand Up @@ -169,17 +164,7 @@ function webViewKey(key) {
}
}
}
}

if (focused !== null) {
if (oldFocused !== null && oldFocused.id && oldFocused.id.startsWith('ch')) {
oldFocused.removeEventListener('keypress', programKey);

}
if (focused.id && focused.id.startsWith('ch')) {
focused.addEventListener('keypress', programKey);
}
}
}
}

if (focused !== null) {
Expand Down
2 changes: 1 addition & 1 deletion src/epg.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ epgApp.directive('popContainer', ['$window', function($window) {
win.unbind('resize', scope.popHide);
});
}
}
};
}]);

epgApp.directive('popClick', ['$timeout', function($timeout) {
Expand Down

0 comments on commit 399e3e1

Please sign in to comment.