Only use Display.setContent
This commit is contained in:
parent
c53947a94a
commit
dbbcfa5739
@ -220,12 +220,12 @@ class DisplaySearch extends Display {
|
||||
this.updateSearchButton();
|
||||
if (valid) {
|
||||
const {definitions} = await apiTermsFind(query, details, this.optionsContext);
|
||||
this.setContentTerms(definitions, {
|
||||
this.setContent('terms', {definitions, context: {
|
||||
focus: false,
|
||||
disableHistory: true,
|
||||
sentence: {text: query, offset: 0},
|
||||
url: window.location.href
|
||||
});
|
||||
}});
|
||||
} else {
|
||||
this.container.textContent = '';
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ class DisplayFloat extends Display {
|
||||
|
||||
onError(error) {
|
||||
if (this._orphaned) {
|
||||
this.setContentOrphaned();
|
||||
this.setContent('orphaned');
|
||||
} else {
|
||||
logError(error, true);
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ class Display {
|
||||
};
|
||||
|
||||
const definitions = await apiKanjiFind(link.textContent, this.getOptionsContext());
|
||||
this.setContentKanji(definitions, context);
|
||||
this.setContent('kanji', {definitions, context});
|
||||
} catch (error) {
|
||||
this.onError(error);
|
||||
}
|
||||
@ -131,7 +131,7 @@ class Display {
|
||||
});
|
||||
}
|
||||
|
||||
this.setContentTerms(definitions, context);
|
||||
this.setContent('terms', {definitions, context});
|
||||
|
||||
if (selectText) {
|
||||
textSource.select();
|
||||
|
Loading…
Reference in New Issue
Block a user