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