Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #32738 from begeeben/1216854_handle_back_space
Browse files Browse the repository at this point in the history
Bug 1216854 - [browser] handle back-space key event in firefox sync process, r=ferjm
  • Loading branch information
begeeben committed Oct 26, 2015
2 parents 1a7646c + 9af144a commit 977db6c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tv_apps/smart-system/fxa/js/fxam_navigation.js
Expand Up @@ -39,6 +39,9 @@ var FxaModuleNavigation = {

var panel = document.querySelector(location.hash);
if (!panel || !panel.classList.contains('screen')) {
// After a user presses backspace key at the first step of the flow,
// the panel will be null and we should close the dialog.
FxaModuleManager.close('DIALOG_CLOSED_BY_USER');
return;
}

Expand Down
8 changes: 8 additions & 0 deletions tv_apps/smart-system/fxa/js/fxam_ui.js
Expand Up @@ -62,6 +62,14 @@ var FxaModuleUI = {
}, OFFLINE_TIMEOUT);
});

window.addEventListener('keypress', function onkeypress(e) {
if (e.keyCode === KeyEvent.DOM_VK_BACK_SPACE) {
// BACK_SPACE key on TV doesn't work for text input elements,
// there's a backspace button to delete text.
FxaModuleNavigation.back();
}
});

FxaModuleNavigation.init(flow);
},
setMaxSteps: function(num) {
Expand Down

0 comments on commit 977db6c

Please sign in to comment.