1 | var __extends = (this && this.__extends) || (function () {
|
2 | var extendStatics = Object.setPrototypeOf ||
|
3 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
4 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
5 | return function (d, b) {
|
6 | extendStatics(d, b);
|
7 | function __() { this.constructor = d; }
|
8 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
9 | };
|
10 | })();
|
11 | import { isPresent } from '../../util/util';
|
12 | import { PORTAL_LOADING } from '../app/app-constants';
|
13 | import { LoadingCmp } from './loading-component';
|
14 | import { LoadingMdPopIn, LoadingMdPopOut, LoadingPopIn, LoadingPopOut, LoadingWpPopIn, LoadingWpPopOut } from './loading-transitions';
|
15 | import { ViewController } from '../../navigation/view-controller';
|
16 |
|
17 |
|
18 |
|
19 | var Loading = (function (_super) {
|
20 | __extends(Loading, _super);
|
21 | function Loading(app, opts, config) {
|
22 | if (opts === void 0) { opts = {}; }
|
23 | var _this = this;
|
24 | opts.showBackdrop = isPresent(opts.showBackdrop) ? !!opts.showBackdrop : true;
|
25 | opts.enableBackdropDismiss = isPresent(opts.enableBackdropDismiss) ? !!opts.enableBackdropDismiss : false;
|
26 | opts.dismissOnPageChange = isPresent(opts.dismissOnPageChange) ? !!opts.dismissOnPageChange : false;
|
27 | _this = _super.call(this, LoadingCmp, opts, null) || this;
|
28 | _this._app = app;
|
29 | _this.isOverlay = true;
|
30 | config.setTransition('loading-pop-in', LoadingPopIn);
|
31 | config.setTransition('loading-pop-out', LoadingPopOut);
|
32 | config.setTransition('loading-md-pop-in', LoadingMdPopIn);
|
33 | config.setTransition('loading-md-pop-out', LoadingMdPopOut);
|
34 | config.setTransition('loading-wp-pop-in', LoadingWpPopIn);
|
35 | config.setTransition('loading-wp-pop-out', LoadingWpPopOut);
|
36 | return _this;
|
37 | }
|
38 | |
39 |
|
40 |
|
41 | Loading.prototype.getTransitionName = function (direction) {
|
42 | var key = (direction === 'back' ? 'loadingLeave' : 'loadingEnter');
|
43 | return this._nav && this._nav.config.get(key);
|
44 | };
|
45 | |
46 |
|
47 |
|
48 | Loading.prototype.setContent = function (content) {
|
49 | this.data.content = content;
|
50 | return this;
|
51 | };
|
52 | |
53 |
|
54 |
|
55 | Loading.prototype.setSpinner = function (spinner) {
|
56 | this.data.spinner = spinner;
|
57 | return this;
|
58 | };
|
59 | |
60 |
|
61 |
|
62 | Loading.prototype.setCssClass = function (cssClass) {
|
63 | this.data.cssClass = cssClass;
|
64 | return this;
|
65 | };
|
66 | |
67 |
|
68 |
|
69 | Loading.prototype.setShowBackdrop = function (showBackdrop) {
|
70 | this.data.showBackdrop = showBackdrop;
|
71 | return this;
|
72 | };
|
73 | |
74 |
|
75 |
|
76 | Loading.prototype.setDuration = function (dur) {
|
77 | this.data.duration = dur;
|
78 | return this;
|
79 | };
|
80 | |
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 | Loading.prototype.present = function (navOptions) {
|
87 | if (navOptions === void 0) { navOptions = {}; }
|
88 | return this._app.present(this, navOptions, PORTAL_LOADING);
|
89 | };
|
90 | |
91 |
|
92 |
|
93 | Loading.prototype.dismissAll = function () {
|
94 | this._nav && this._nav.popAll();
|
95 | };
|
96 | return Loading;
|
97 | }(ViewController));
|
98 | export { Loading };
|
99 |
|
\ | No newline at end of file |