From 345b9c6f9dc336265f4ef8cd67cc2beb57abe354 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Fri, 9 Aug 2019 22:29:14 -0400 Subject: Disable focus of popup when using touch Context menu on Firefox will not target the text properly if the focus is on the popup window. --- ext/mixed/js/display.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ext/mixed') diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js index 3bb78fe1..5bd57159 100644 --- a/ext/mixed/js/display.js +++ b/ext/mixed/js/display.js @@ -269,7 +269,9 @@ class Display { async termsShow(definitions, options, context) { try { - window.focus(); + if (context && context.focus) { + window.focus(); + } this.definitions = definitions; this.options = options; @@ -321,7 +323,9 @@ class Display { async kanjiShow(definitions, options, context) { try { - window.focus(); + if (context && context.focus) { + window.focus(); + } this.definitions = definitions; this.options = options; -- cgit v1.2.3 From cd1f367798678800a8ed7f6658362b2cbd95a632 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Fri, 16 Aug 2019 17:36:55 -0400 Subject: Focus if context is falsy or focus field isn't false --- ext/mixed/js/display.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/mixed') diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js index 5bd57159..8901ba71 100644 --- a/ext/mixed/js/display.js +++ b/ext/mixed/js/display.js @@ -269,7 +269,7 @@ class Display { async termsShow(definitions, options, context) { try { - if (context && context.focus) { + if (!context || context.focus !== false) { window.focus(); } @@ -323,7 +323,7 @@ class Display { async kanjiShow(definitions, options, context) { try { - if (context && context.focus) { + if (!context || context.focus !== false) { window.focus(); } -- cgit v1.2.3