Cleanup
This commit is contained in:
parent
8f776cf759
commit
f653195aed
@ -183,26 +183,20 @@ class Client {
|
|||||||
}
|
}
|
||||||
|
|
||||||
api_displayKanji(kanji) {
|
api_displayKanji(kanji) {
|
||||||
let defs = [];
|
|
||||||
let seq = -1;
|
|
||||||
|
|
||||||
bgFindKanji(kanji).then(definitions => {
|
bgFindKanji(kanji).then(definitions => {
|
||||||
definitions.forEach(definition => definition.url = window.location.href);
|
definitions.forEach(definition => definition.url = window.location.href);
|
||||||
|
|
||||||
defs = definitions;
|
const sequence = ++this.sequence;
|
||||||
seq = ++this.sequence;
|
return bgRenderText({definitions, sequence, root: this.fgRoot, options: this.options}, 'kanji-list.html').then(content => {
|
||||||
|
this.definitions = definitions;
|
||||||
return bgRenderText({definitions, root: this.fgRoot, options: this.options, sequence: seq}, 'kanji-list.html');
|
this.popup.setContent(content, definitions);
|
||||||
}).then(content => {
|
return bgCanAddDefinitions(definitions, ['kanji']);
|
||||||
this.definitions = defs;
|
|
||||||
this.popup.setContent(content, defs);
|
|
||||||
|
|
||||||
return bgCanAddDefinitions(defs, ['kanji']);
|
|
||||||
}).then(states => {
|
}).then(states => {
|
||||||
if (states !== null) {
|
if (states !== null) {
|
||||||
states.forEach((state, index) => this.popup.sendMessage('setActionState', {index, state, sequence: seq}));
|
states.forEach((state, index) => this.popup.sendMessage('setActionState', {index, state, sequence}));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static textSourceFromPoint(point) {
|
static textSourceFromPoint(point) {
|
||||||
|
Loading…
Reference in New Issue
Block a user