diff options
author | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-08 22:28:02 +0000 |
---|---|---|
committer | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-08 22:28:02 +0000 |
commit | 1b66eab3d49733d5a256fa119469ccb8adec7c01 (patch) | |
tree | 4d57486f2486e7c9119fbf50273724b61df92553 | |
parent | 1790319d7aad0679a73f2d757a6f34c18b29b875 (diff) | |
download | chromium_src-1b66eab3d49733d5a256fa119469ccb8adec7c01.zip chromium_src-1b66eab3d49733d5a256fa119469ccb8adec7c01.tar.gz chromium_src-1b66eab3d49733d5a256fa119469ccb8adec7c01.tar.bz2 |
Fix subpages closing on clicking radio/checkbox span problem.
Clicking on a radio/checkbox label span on a subpage closes it. Clicking
on a label span generates a click event for its target input and that
generated event has (0,0) as its client coordinates. This breaks our
subpage close logic.
BUG=chromium-os:12679
TEST=Verify fix for chromium-os:12679.
Review URL: http://codereview.chromium.org/6652001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77347 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/resources/options/options_page.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/browser/resources/options/options_page.js b/chrome/browser/resources/options/options_page.js index e7d43c8..03da35f 100644 --- a/chrome/browser/resources/options/options_page.js +++ b/chrome/browser/resources/options/options_page.js @@ -659,6 +659,12 @@ cr.define('options', function() { if (!topPage || topPage.isOverlay || !topPage.parentPage) return; + // Do nothing if there is no client coordinates. + // When user clicks on a radio/checkbox label span, a click event will be + // generated on target radio/checkbox but with client coordinates (0, 0). + if (!event.clientX && !event.clientY) + return; + // Don't interfere with navbar clicks. if ($('navbar').contains(event.target)) return; |