From 659fa494ce9c2a326098f93d5b926206c38a10aa Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Mon, 28 Sep 2015 14:13:45 -0500 Subject: [PATCH] Loading --- ionic/platform/loading/loading.ts | 48 +++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/ionic/platform/loading/loading.ts b/ionic/platform/loading/loading.ts index acade15201..113d533778 100644 --- a/ionic/platform/loading/loading.ts +++ b/ionic/platform/loading/loading.ts @@ -5,6 +5,15 @@ import {NativePlugin} from '../plugin'; /** * Simple loading popup indicators. + * + * Uses the `cordova-plugin-progressindicator` Cordova plugin. See the [plugin docs](http://paolobernasconi.com/cordova-progressIndicator/) + * for more information. + * + * @usage + * + * ```js + * Loading.show(true, 'Waiting...') // Dim the background and show label + * ``` */ @NativePlugin({ name: 'Loading', @@ -17,6 +26,14 @@ import {NativePlugin} from '../plugin'; } }) export class Loading { + + /** + * Show a simple loading box. + * + * @param dim {Boolean} whether the dim the background + * @param label {String} the custom label + * @param detail {String} any detail text + */ static simple(dim, label, detail) { this.ifPlugin(() => { if(typeof label === 'undefined') { @@ -33,6 +50,14 @@ export class Loading { }) } + /** + * Show a deteriminate loading box with progress bar + * that completes after a certain amount of time + * + * @param dim {Boolean} whether the dim the background + * @param timeout {Integer} the timeout for the loading box + * @param label {String} the custom label + */ static determinate(dim, timeout, label) { this.ifPlugin(() => { if(typeof label === 'undefined') { @@ -47,6 +72,13 @@ export class Loading { }) } + /** + * Show a spinning circle + * + * @param dim {Boolean} whether the dim the background + * @param timeout {Integer} the timeout for the loading box + * @param label {String} the custom label + */ static annular(dim, timeout, label) { this.ifPlugin(() => { if(typeof label === 'undefined') { @@ -61,6 +93,13 @@ export class Loading { }) } + /** + * Show a bar + * + * @param dim {Boolean} whether the dim the background + * @param timeout {Integer} the timeout for the loading box + * @param label {String} the custom label + */ static bar(dim, timeout, label) { this.ifPlugin(() => { if(typeof label === 'undefined') { @@ -75,12 +114,21 @@ export class Loading { }) } + /** + * Show a success checkmark + * + * @param dim {Boolean} whether the dim the background + * @param label {String} the custom label + */ static success(dim, label) { this.ifPlugin(() => { window.ProgressIndicator.showSuccess(dim, label); }) } + /** + * Hide a loading box + */ static hide() { this.ifPlugin(() => { window.ProgressIndicator.hide();