fix: dialogs.select() arguments' parsing
This commit is contained in:
@@ -69,7 +69,7 @@ module.exports = function(__runtime__, scope){
|
|||||||
}
|
}
|
||||||
return rtDialogs().select(title, items, callback ? callback : null);
|
return rtDialogs().select(title, items, callback ? callback : null);
|
||||||
}
|
}
|
||||||
return rtDialogs().select(title, [].slice.call(arguments, 1));
|
return rtDialogs().select(title, [].slice.call(arguments, 1), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
dialogs.singleChoice = function(title, items, index, callback){
|
dialogs.singleChoice = function(title, items, index, callback){
|
||||||
|
|||||||
@@ -77,9 +77,7 @@ public class Dialogs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ScriptInterface
|
@ScriptInterface
|
||||||
public Object select(String title, Object... args) {
|
public Object select(String title, String[] items, Object callback) {
|
||||||
Object callback = getCallback(args);
|
|
||||||
String[] items = getItems(args);
|
|
||||||
return ((BlockedMaterialDialog.Builder) dialogBuilder(callback)
|
return ((BlockedMaterialDialog.Builder) dialogBuilder(callback)
|
||||||
.itemsCallback()
|
.itemsCallback()
|
||||||
.title(title)
|
.title(title)
|
||||||
@@ -152,8 +150,8 @@ public class Dialogs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ScriptInterface
|
@ScriptInterface
|
||||||
public int select(String title, Object... args) {
|
public int select(String title, String[] items, Object callback) {
|
||||||
return (Integer) Dialogs.this.select(title, args);
|
return (Integer) Dialogs.this.select(title, items, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ScriptInterface
|
@ScriptInterface
|
||||||
|
|||||||
Reference in New Issue
Block a user