Index: chrome/browser/resources/ntp4/apps_page.js |
diff --git a/chrome/browser/resources/ntp4/apps_page.js b/chrome/browser/resources/ntp4/apps_page.js |
index 8136080e00827767e1f94f2f4a2b825a27229f52..647ec829aa081be7bdb179617d92426367706d68 100644 |
--- a/chrome/browser/resources/ntp4/apps_page.js |
+++ b/chrome/browser/resources/ntp4/apps_page.js |
@@ -295,7 +295,7 @@ cr.define('ntp', function() { |
this.addEventListener('mousedown', this.onMousedown_, true); |
this.addEventListener('keydown', this.onKeydown_); |
- this.addEventListener('keyup', this.onKeyup_); |
+ this.addEventListener('blur', this.onBlur_); |
}, |
/** |
@@ -378,6 +378,11 @@ cr.define('ntp', function() { |
this.style.top = toCssPx(y); |
}, |
+ onBlur_: function(e) { |
+ this.classList.remove('click-focus'); |
+ this.appContents_.classList.remove('suppress-active'); |
+ }, |
+ |
/** |
* Invoked when an app is clicked. |
* @param {Event} e The click event. |
@@ -410,33 +415,6 @@ cr.define('ntp', function() { |
e.preventDefault(); |
e.stopPropagation(); |
} |
- this.onKeyboardUsed_(e.keyCode); |
- }, |
- |
- /** |
- * Invoked when the user releases a key while the app is focused. |
- * @param {Event} e The key event. |
- * @private |
- */ |
- onKeyup_: function(e) { |
- this.onKeyboardUsed_(e.keyCode); |
- }, |
- |
- /** |
- * Called when the keyboard has been used (key down or up). The .click-focus |
- * hack is removed if the user presses a key that can change focus. |
- * @param {number} keyCode The key code of the keyboard event. |
- * @private |
- */ |
- onKeyboardUsed_: function(keyCode) { |
- switch (keyCode) { |
- case 9: // Tab. |
- case 37: // Left arrow. |
- case 38: // Up arrow. |
- case 39: // Right arrow. |
- case 40: // Down arrow. |
- this.classList.remove('click-focus'); |
- } |
}, |
/** |