Merge pull request #231 from aurimasv/defaultHandlers

Set default handlers if they are not set
This commit is contained in:
Simon Kornblith 2013-01-20 23:20:46 -08:00
commit 7c24c27fb3

View file

@ -179,12 +179,13 @@ Zotero.Translate.Sandbox = {
*/
"loadTranslator":function(translate, type) {
const setDefaultHandlers = function(translate, translation) {
if(Zotero.Utilities.isEmpty(translation._handlers)) {
if(type !== "export") {
if(type !== "export"
&& (!translation._handlers['itemDone'] || !translation._handlers['itemDone'].length)) {
translation.setHandler("itemDone", function(obj, item) {
translate.Sandbox._itemDone(translate, item);
});
}
if(!translation._handlers['selectItems'] || !translation._handlers['selectItems'].length) {
translation.setHandler("selectItems", translate._handlers["selectItems"]);
}
}