summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-15 20:52:28 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-15 20:52:28 +0000
commited875647795b7886bb90d2e289492df1c7da1cec (patch)
treec1f69dd0e17a483b8031d1b86ab2983bb548d758 /chrome
parentf16532a7c0277e1876d4b8c75992faeef7e5867e (diff)
downloadchromium_src-ed875647795b7886bb90d2e289492df1c7da1cec.zip
chromium_src-ed875647795b7886bb90d2e289492df1c7da1cec.tar.gz
chromium_src-ed875647795b7886bb90d2e289492df1c7da1cec.tar.bz2
DOMUI Options: Add esc handling for closing subpages
BUG=65665 TEST=Open a subpage, click on a control in it, and then press esc. The subpage should close. Review URL: http://codereview.chromium.org/5916001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69308 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/resources/options/options_page.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/resources/options/options_page.js b/chrome/browser/resources/options/options_page.js
index aa69415..f0c750e 100644
--- a/chrome/browser/resources/options/options_page.js
+++ b/chrome/browser/resources/options/options_page.js
@@ -241,11 +241,16 @@ cr.define('options', function() {
// Set up the overlay sheet. Clicks on the visible part of the parent page
// should close the overlay, not fall through to the parent page.
var self = this;
- $('subpage-sheet-container').onclick = function(event) {
+ var subpageContainer = $('subpage-sheet-container');
+ subpageContainer.onclick = function(event) {
if (!$('subpage-sheet').contains(event.target))
self.closeSubPage();
event.stopPropagation();
}
+ subpageContainer.onkeydown = function(e) {
+ if (e.keyCode == 27) // Esc
+ self.closeSubPage();
+ };
};
/**