clear Display history on new lookup

This commit is contained in:
siikamiika 2019-11-28 18:24:24 +02:00
parent 1f2734863f
commit 1dd88763de
2 changed files with 11 additions and 1 deletions

View File

@ -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;

View File

@ -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();
}