From 25237f1425bacc19d9b8692883ae8a1a5af03ad3 Mon Sep 17 00:00:00 2001 From: Pepe Bawagan Date: Wed, 30 Apr 2014 19:28:51 +0800 Subject: [PATCH] let new tab shortcuts work normally for links enables ctrl-clicking, middle-clicking, etc. for anchors when using pathname routing --- mithril.js | 1 + 1 file changed, 1 insertion(+) diff --git a/mithril.js b/mithril.js index d4457a4d..7eee8e37 100644 --- a/mithril.js +++ b/mithril.js @@ -314,6 +314,7 @@ Mithril = m = new function app(window) { } } function routeUnobtrusive(e) { + if (e.ctrlKey || e.metaKey || e.which == 2) return e.preventDefault() m.route(e.currentTarget.getAttribute("href")) }