From 5a14ec01efd2d87d55cf29ed9743aa1d7044514d Mon Sep 17 00:00:00 2001 From: mhartington Date: Fri, 1 Jul 2016 11:38:12 -0400 Subject: [PATCH] docs(actionSheet): improve docs --- scripts/docs/tag-defs/tag-defs.js | 1 + scripts/docs/templates/common.template.html | 7 +++++ src/plugins/actionsheet.ts | 34 ++++++++++++--------- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/scripts/docs/tag-defs/tag-defs.js b/scripts/docs/tag-defs/tag-defs.js index ca0dabb3..5c0803cc 100644 --- a/scripts/docs/tag-defs/tag-defs.js +++ b/scripts/docs/tag-defs/tag-defs.js @@ -1,4 +1,5 @@ module.exports = [ + {'name': 'advanced'}, {'name': 'demo'}, {'name': 'usage'} ]; diff --git a/scripts/docs/templates/common.template.html b/scripts/docs/templates/common.template.html index 886f8487..d75fde0b 100644 --- a/scripts/docs/templates/common.template.html +++ b/scripts/docs/templates/common.template.html @@ -276,6 +276,13 @@ docType: "<$ doc.docType $>" <@- endif -@> +<@ block advanced @> +<@- if doc.advanced -@> +

Advanced

+<$ doc.advanced | marked $> +<@- endif -@> +<@ endblock @> + <@- if doc.see @> diff --git a/src/plugins/actionsheet.ts b/src/plugins/actionsheet.ts index e0368320..4ccbbedf 100644 --- a/src/plugins/actionsheet.ts +++ b/src/plugins/actionsheet.ts @@ -22,6 +22,21 @@ import {Plugin, Cordova} from './plugin'; * }); * ``` * + * @advanced + * ActionSheet options + * + * | Option | Type | Description | + * |-------------------------------|-----------|----------------------------------------------| + * | title |`string` | The title for the actionsheet | + * | buttonLabels |`string[]` | the labels for the buttons. Uses the index x | + * | androidTheme |`number` | Theme to be used on Android | + * | androidEnableCancelButton |`boolean` | Enable a cancel on Android | + * | winphoneEnableCancelButton |`boolean` | Enable a cancel on Windows Phone | + * | addCancelButtonWithLabel |`string` | Add a cancel button with text | + * | addDestructiveButtonWithLabel |`string` | Add a destructive button with text | + * | position |`number[]` | On an iPad, set the X,Y position | + * + * */ @Plugin({ plugin: 'cordova-plugin-actionsheet', @@ -32,20 +47,8 @@ import {Plugin, Cordova} from './plugin'; export class ActionSheet { /** - * Show the ActionSheet. The ActionSheet's options is an object with the following propterties. - * - * | Option | Type | Description | - * |-------------------------------|-----------|----------------------------------------------| - * | title |`string` | The title for the actionsheet | - * | buttonLabels |`string[]` | the labels for the buttons. Uses the index x | - * | androidTheme |`number` | Theme to be used on Android | - * | androidEnableCancelButton |`boolean` | Enable a cancel on Android | - * | winphoneEnableCancelButton |`boolean` | Enable a cancel on Windows Phone | - * | addCancelButtonWithLabel |`string` | Add a cancel button with text | - * | addDestructiveButtonWithLabel |`string` | Add a destructive button with text | - * | position |`number[]` | On an iPad, set the X,Y position | - * - * @param {options} Options See table above + * Show a native ActionSheet component. See below for options. + * @param {options} Options See table below * @returns {Promise} Returns a Promise that resolves with the index of the * button pressed (1 based, so 1, 2, 3, etc.) */ @@ -63,7 +66,8 @@ export class ActionSheet { /** - * Hide the ActionSheet. + * Progamtically hide the native ActionSheet + * @returns {Promise} Returns a Promise that resolves when the actionsheet is closed */ @Cordova() static hide(): Promise { return; }