From 6cfd84b27812d51585c3c259a121f9e9143aec58 Mon Sep 17 00:00:00 2001 From: Aaron Boodman Date: Sat, 28 Jun 2014 20:00:48 -0700 Subject: [PATCH] Don't do local navigation if a modifier key is pressed. Change-Id: I8e3996628f8c247652c8a51a8bcf602d5bdfef02 --- server/camlistored/ui/navigator.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/camlistored/ui/navigator.js b/server/camlistored/ui/navigator.js index 76503e701..e39383b67 100644 --- a/server/camlistored/ui/navigator.js +++ b/server/camlistored/ui/navigator.js @@ -51,9 +51,12 @@ cam.Navigator.prototype.navigate = function(url) { // Handles navigations initiated via clicking a hyperlink. cam.Navigator.prototype.handleClick_ = function(e) { - if (e.button != 0) { + // We are conservative and only try to handle left clicks that are unmodified. + // For any other kind of click, assume that something fancy (e.g., context menu, open in new tab, etc) is about to happen and let whatever it happen as normal. + if (e.button != 0 || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { return; } + for (var elm = e.target; ; elm = elm.parentElement) { if (!elm) { return;