summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-06 00:43:36 +0000
committerarv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-06 00:43:36 +0000
commitc86f9c68956083534c06e59eab7b690819f79fcf (patch)
tree2964c0625fc15d4ccb010931e9cab648f7f275a2
parent0e9451ef8a141f6a5e878d0bf975cbde98b17aa2 (diff)
downloadchromium_src-c86f9c68956083534c06e59eab7b690819f79fcf.zip
chromium_src-c86f9c68956083534c06e59eab7b690819f79fcf.tar.gz
chromium_src-c86f9c68956083534c06e59eab7b690819f79fcf.tar.bz2
NTP: Make sure that we do not focus the thumbnails on mouse down.
We used to focus the thumbnail on mousedown which makes the thumbmail hover effect show up which confuses users. BUG=31361 TEST=Right click on a thumbnail and dismiss the context menu. The thumbnail should not be focused. Review URL: http://codereview.chromium.org/525045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35589 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/resources/new_new_tab.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/browser/resources/new_new_tab.js b/chrome/browser/resources/new_new_tab.js
index 093e36a..7bdb9ef 100644
--- a/chrome/browser/resources/new_new_tab.js
+++ b/chrome/browser/resources/new_new_tab.js
@@ -1497,6 +1497,13 @@ var dnd = {
this.startY = item.offsetTop;
this.startScreenX = e.screenX;
this.startScreenY = e.screenY;
+
+ // We don't want to focus the item on mousedown. However, to prevent focus
+ // one has to call preventDefault but this also prevents the drag and drop
+ // (sigh) so we only prevent it when the user is not doing a left mouse
+ // button drag.
+ if (e.button != 0) // LEFT
+ e.preventDefault();
}
},