diff --git a/autojs/src/main/assets/modules/__dialogs__.js b/autojs/src/main/assets/modules/__dialogs__.js index d2a53054..f1615849 100644 --- a/autojs/src/main/assets/modules/__dialogs__.js +++ b/autojs/src/main/assets/modules/__dialogs__.js @@ -155,7 +155,7 @@ module.exports = function(__runtime__, scope){ builder.input(wrapNonNullString(properties.inputHint), wrapNonNullString(properties.inputPrefill), function(dialog, input){ input = input.toString(); - dialog.emit("input_change", dialog, input); + builder.dialog.emit("input_change", builder.dialog, input); }) .alwaysCallInputCallback(); } @@ -163,23 +163,23 @@ module.exports = function(__runtime__, scope){ var itemsSelectMode = properties.itemsSelectMode; if(itemsSelectMode == undefined || itemsSelectMode == 'select'){ builder.itemsCallback(function(dialog, view, position, text){ - dialog.emit("item_select", position, text.toString(), dialog); + builder.dialog.emit("item_select", position, text.toString(), builder.dialog); }); }else if(itemsSelectMode == 'single'){ builder.itemsCallbackSingleChoice(properties.itemsSelectedIndex == undefined ? -1 : properties.itemsSelectedIndex, function(dialog, view, which, text){ - dialog.emit("single_choice", which, text.toString(), dialog); + builder.dialog.emit("single_choice", which, text.toString(), builder.dialog); return true; }); }else if(itemsSelectMode == 'multi'){ builder.itemsCallbackMultiChoice(properties.itemsSelectedIndex == undefined ? null : properties.itemsSelectedIndex, function(dialog, view, indices, texts){ - dialog.emit("multi_choice", toJsArray(indices, (l, i)=> parseInt(l.get(i)), - toJsArray(texts, (l, i)=> l.get(i).toString())), dialog); + builder.dialog.emit("multi_choice", toJsArray(indices, (l, i)=> parseInt(l.get(i)), + toJsArray(texts, (l, i)=> l.get(i).toString())), builder.dialog); return true; }); }else{ - throw new Error("unknown itemsSelecteMode " + itemsSelectMode); + throw new Error("unknown itemsSelectMode " + itemsSelectMode); } } if(properties.progress != undefined){