diff options
| author | siikamiika <siikamiika@users.noreply.github.com> | 2019-11-28 18:24:24 +0200 | 
|---|---|---|
| committer | siikamiika <siikamiika@users.noreply.github.com> | 2019-11-28 18:24:24 +0200 | 
| commit | 1dd88763de8e4ad2728d87dd33defb9cf1a71a42 (patch) | |
| tree | e5c94c1324af9386f9b6c70cbb73fcbe4f0894fa | |
| parent | 1f2734863f2f9213fd6c2db196d2b20969a7ee99 (diff) | |
clear Display history on new lookup
| -rw-r--r-- | ext/fg/js/frontend.js | 2 | ||||
| -rw-r--r-- | ext/mixed/js/display.js | 10 | 
2 files changed, 11 insertions, 1 deletions
| 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();              } |