Skip to content

Instantly share code, notes, and snippets.

@alivedise
Created August 14, 2015 08:44
Show Gist options
  • Save alivedise/35ef43af9cd661aca80c to your computer and use it in GitHub Desktop.
Save alivedise/35ef43af9cd661aca80c to your computer and use it in GitHub Desktop.
patch for mozbrowserafterkeydown in HM
diff --git a/js/app_window.js b/js/app_window.js
index 19e2bf9..2c84ec4 100644
--- a/js/app_window.js
+++ b/js/app_window.js
@@ -967,6 +967,12 @@
}
};
+ AppWindow.prototype.handleKeydown = function(evt) {
+ if (this.valueSelector && this.valueSelector.isShown()) {
+ this.valueSelector.handleKeydown(evt);
+ }
+ };
+
AppWindow.prototype._handle_mozbrowservisibilitychange =
function aw__handle_mozbrowservisibilitychange(evt) {
var type = evt.detail.visible ? 'foreground' : 'background';
diff --git a/js/app_window_manager.js b/js/app_window_manager.js
index b25c3f3..075b41d 100644
--- a/js/app_window_manager.js
+++ b/js/app_window_manager.js
@@ -424,6 +424,18 @@
this.service.request('unregisterHierarchy', this);
},
+
+ '_handle_mozbrowserafterkeydown': function(evt) {
+ if (this._activeApp) {
+ this.debug(' Resizing ' + this._activeApp.name);
+ if (!this._activeApp.isTransitioning()) {
+ this._activeApp.getTopMostWindow().handleKeydown(evt);
+ return false;
+ }
+ }
+ return true;
+ },
+
'_handle_system-resize': function(evt) {
if (this._activeApp) {
this.debug(' Resizing ' + this._activeApp.name);
diff --git a/js/hierarchy_manager.js b/js/hierarchy_manager.js
index fd79b2b..4286ae9 100644
--- a/js/hierarchy_manager.js
+++ b/js/hierarchy_manager.js
@@ -19,7 +19,8 @@
'launchactivity',
'mozChromeEvent',
'windowopened',
- 'windowclosed'
+ 'windowclosed',
+ 'mozbrowserafterkeydown'
];
BaseModule.create(HierarchyManager, {
name: 'HierarchyManager',
@@ -169,6 +170,7 @@
case 'launchactivity':
case 'webapps-launch':
case 'system-resize':
+ case 'mozbrowserafterkeydown':
this.broadcast(evt);
break;
default:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment