From 3e3aeffce18102ff1479ffc7419925640e537914 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 2 Mar 2015 20:47:50 -0800 Subject: [PATCH] Remove focus outlines around links only when they were focused with the mouse. --- src/General/Main.coffee | 5 +++++ src/General/css/style.css | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 98c16fa72..13b0461b6 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -105,6 +105,11 @@ Main = $.addClass doc, if chrome? then 'blink' else 'gecko' $.addStyle Main.css, 'fourchanx-css' + mouse = false + $.on d, 'mousedown', -> mouse = true + $.on d, 'keydown', -> mouse = false + window.addEventListener 'focus', (-> doc.classList.toggle 'mouse-focus', mouse), true + Main.setClass() setClass: -> diff --git a/src/General/css/style.css b/src/General/css/style.css index 2a93322cc..aaaefd45c 100755 --- a/src/General/css/style.css +++ b/src/General/css/style.css @@ -64,6 +64,9 @@ a[href="javascript:;"] { body.hasDropDownNav{ margin-top: 5px; } +:root.mouse-focus a { + outline: none; +} .painted { border-radius: 3px; padding: 0px 2px;