Skip to content

Commit

Permalink
docs(actionSheet): improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mhartington committed Jul 1, 2016
1 parent 3a62108 commit 5a14ec0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 15 deletions.
1 change: 1 addition & 0 deletions scripts/docs/tag-defs/tag-defs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = [
{'name': 'advanced'},
{'name': 'demo'},
{'name': 'usage'}
];
7 changes: 7 additions & 0 deletions scripts/docs/templates/common.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,13 @@ <h4> Method's `this`

<@- endif -@>

<@ block advanced @>
<@- if doc.advanced -@>
<h2><a class="anchor" name="advanced" href="#advanced"></a>Advanced</h2>
<$ doc.advanced | marked $>
<@- endif -@>
<@ endblock @>

<!-- related link -->
<@- if doc.see @>

Expand Down
34 changes: 19 additions & 15 deletions src/plugins/actionsheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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.)
*/
Expand All @@ -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<any> { return; }
Expand Down

0 comments on commit 5a14ec0

Please sign in to comment.