Fix translator tester on xul extension
This commit is contained in:
parent
353b935c74
commit
3ca5526f29
|
@ -550,7 +550,15 @@ function haveTranslators(translators, type) {
|
||||||
return a.label.localeCompare(b.label);
|
return a.label.localeCompare(b.label);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var promises = [];
|
||||||
for(var i in translators) {
|
for(var i in translators) {
|
||||||
|
promises.push(translators[i].getCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
return Promise.all(promises).then(function(codes) {
|
||||||
|
for(var i in translators) {
|
||||||
|
// Make sure translator code is cached on the object
|
||||||
|
translators[i].code = codes[i];
|
||||||
var translatorTestView = new TranslatorTestView();
|
var translatorTestView = new TranslatorTestView();
|
||||||
translatorTestView.initWithTranslatorAndType(translators[i], type);
|
translatorTestView.initWithTranslatorAndType(translators[i], type);
|
||||||
if(translatorTestView.canRun) {
|
if(translatorTestView.canRun) {
|
||||||
|
@ -562,6 +570,7 @@ function haveTranslators(translators, type) {
|
||||||
var ev = document.createEvent('HTMLEvents');
|
var ev = document.createEvent('HTMLEvents');
|
||||||
ev.initEvent('ZoteroHaveTranslators-'+type, true, true);
|
ev.initEvent('ZoteroHaveTranslators-'+type, true, true);
|
||||||
document.dispatchEvent(ev);
|
document.dispatchEvent(ev);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user