If no web view is showing that uses displays options, the action returns undefined. Otherwise, the action returns an object containing the current values for the display options that have been set, or the default value for the options (when applicable):
Property | Platform | Value |
"width" | All | The desired width, in display units or a percent, of the dialog. |
"height" | All | The desired height, in display units or a percent, of the dialog, or the question text (on Windows only). |
"resizable" | Windows | If true, the dialog can be resized. |
"borderColor" | Windows | The color of the dialog border, which can be specified as a HTML color name (like "red") or a hex color code (like "#ff0000"). |
"titleBarColor" | Windows | The color of the dialog's title bar. |
"titleBarHeight" | Windows | The height, in display units, of the dialog's title bar. |
"keyboard" | Android | If true, the soft keyboard is brought to the forefront when the dialog is shown. |
The action does not throw exceptions.
<script>
const CS = new CSProActionInvoker();
// get the initial display options
const displayOptions = CS.UI.getDisplayOptions();
// if the user has not provided an explicit width and height, size the dialog
// to 100% of the available width and 50% of the available height
if( !displayOptions.width || !displayOptions.height ) {
displayOptions.width = "100%";
displayOptions.height = "50%";
// size the dialog by setting the display options
CS.UI.setDisplayOptionsAsync(displayOptions);
}
</script>