Fix connector server changes for async getTranslators()

This commit is contained in:
Simon Kornblith 2013-08-17 01:23:50 -04:00
parent f397b0e3d1
commit efc4455476

View file

@ -87,17 +87,17 @@ Zotero.Server.Connector.GetTranslators.prototype = {
*/
"init":function(data, sendResponseCallback) {
// Translator data
var me = this;
if(data.url) {
var me = this;
Zotero.Translators.getWebTranslatorsForLocation(data.url).then(function(data) {
sendResponseCallback(200, "application/json",
JSON.stringify(me._serializeTranslators(data[0])));
});
} else {
Zotero.Translators.getAll().then(function(translators) {
var responseData = this._serializeTranslators(translators);
var responseData = me._serializeTranslators(translators);
sendResponseCallback(200, "application/json", JSON.stringify(responseData));
}).fail(function() {
}).fail(function(e) {
sendResponseCallback(500);
throw e;
}).done();