From 1dd88763de8e4ad2728d87dd33defb9cf1a71a42 Mon Sep 17 00:00:00 2001 From: siikamiika Date: Thu, 28 Nov 2019 18:24:24 +0200 Subject: clear Display history on new lookup --- ext/fg/js/frontend.js | 2 +- ext/mixed/js/display.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js index bcdfd152..b19e44d2 100644 --- a/ext/fg/js/frontend.js +++ b/ext/fg/js/frontend.js @@ -398,7 +398,7 @@ class Frontend { textSource.getRect(), textSource.getWritingMode(), type, - {definitions, context: {sentence, url, focus}} + {definitions, context: {sentence, url, focus, clearHistoryOnce: true}} ); this.textSourceCurrent = textSource; diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js index bd4dc0d0..d83efc13 100644 --- a/ext/mixed/js/display.js +++ b/ext/mixed/js/display.js @@ -351,6 +351,11 @@ class Display { this.setEventListenersActive(false); + if (context.clearHistoryOnce) { + delete context.clearHistoryOnce; + this.poppedContextHistory = []; + } + if (context.focus !== false) { window.focus(); } @@ -406,6 +411,11 @@ class Display { this.setEventListenersActive(false); + if (context.clearHistoryOnce) { + delete context.clearHistoryOnce; + this.poppedContextHistory = []; + } + if (context.focus !== false) { window.focus(); } -- cgit v1.2.3