Merge pull request #231 from aurimasv/defaultHandlers
Set default handlers if they are not set
This commit is contained in:
commit
7c24c27fb3
1 changed files with 7 additions and 6 deletions
|
@ -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"]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue