Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
  • 3 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
View
18 AS/NativeAlert/src/pl/mateuszmackowiak/nativeANE/dialogs/NativeTextInputDialog.as
@@ -77,8 +77,14 @@ package pl.mateuszmackowiak.nativeANE.dialogs
if(title!= null && title!=="")
_title = title;
- if(buttons!=null)
- _buttons = buttons;
+ if (!buttons || buttons.length == 0){
+ //no buttons exist, lets make the default buttons
+ trace("Buttons not configured, assigning default CANCEL,OK buttons");
+ buttons = new Vector.<String>();
+ buttons.push("Cancel","OK");
+ }
+ _buttons = buttons;
+
if(textInputs==null || textInputs.length==0){
throw new Error("textInputs cannot be null");
@@ -94,10 +100,14 @@ package pl.mateuszmackowiak.nativeANE.dialogs
var message:String = null;
if(textInputs[0].editable==false)
message = textInputs[0].text;
- if(buttons.length>1)
+ if(buttons.length>2){
trace("Warning: There can be only 2 buttons on IOS NativeTextInputDialog");
- if(textInputs.length>2)
+ return false;
+ }
+ if(textInputs.length>3){
trace("Warning: There can be max only 3 NativeTextFields (first with editable==false to display aditional message) on IOS NativeTextInputDialog ");
+ return false;
+ }
context.call("show",_title,message,textInputs,buttons);
return true;
}

No commit comments for this range

Something went wrong with that request. Please try again.