a zip code crypto-currency system good for red ONLY

nav.js 8.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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. (function (factory) {
  12. if (typeof module === "object" && typeof module.exports === "object") {
  13. var v = factory(require, exports);
  14. if (v !== undefined) module.exports = v;
  15. }
  16. else if (typeof define === "function" && define.amd) {
  17. define(["require", "exports", "@angular/core", "../app/app", "../../config/config", "../../navigation/deep-linker", "../../platform/dom-controller", "../../gestures/gesture-controller", "../../navigation/nav-controller", "../../navigation/nav-controller-base", "../../platform/platform", "../../transitions/transition-controller", "../../navigation/view-controller", "../split-pane/split-pane"], factory);
  18. }
  19. })(function (require, exports) {
  20. "use strict";
  21. Object.defineProperty(exports, "__esModule", { value: true });
  22. var core_1 = require("@angular/core");
  23. var app_1 = require("../app/app");
  24. var config_1 = require("../../config/config");
  25. var deep_linker_1 = require("../../navigation/deep-linker");
  26. var dom_controller_1 = require("../../platform/dom-controller");
  27. var gesture_controller_1 = require("../../gestures/gesture-controller");
  28. var nav_controller_1 = require("../../navigation/nav-controller");
  29. var nav_controller_base_1 = require("../../navigation/nav-controller-base");
  30. var platform_1 = require("../../platform/platform");
  31. var transition_controller_1 = require("../../transitions/transition-controller");
  32. var view_controller_1 = require("../../navigation/view-controller");
  33. var split_pane_1 = require("../split-pane/split-pane");
  34. /**
  35. * @name Nav
  36. * @description
  37. *
  38. * `ion-nav` is the declarative component for a [NavController](../../../navigation/NavController/).
  39. *
  40. * For more information on using nav controllers like Nav or [Tab](../../Tabs/Tab/),
  41. * take a look at the [NavController API Docs](../../../navigation/NavController/).
  42. *
  43. *
  44. * @usage
  45. * You must set a root page to be loaded initially by any Nav you create, using
  46. * the 'root' property:
  47. *
  48. * ```ts
  49. * import { Component } from '@angular/core';
  50. * import { GettingStartedPage } from './getting-started';
  51. *
  52. * @Component({
  53. * template: `<ion-nav [root]="root"></ion-nav>`
  54. * })
  55. * class MyApp {
  56. * root = GettingStartedPage;
  57. *
  58. * constructor(){
  59. * }
  60. * }
  61. * ```
  62. *
  63. * @demo /docs/demos/src/navigation/
  64. * @see {@link /docs/components#navigation Navigation Component Docs}
  65. */
  66. var Nav = (function (_super) {
  67. __extends(Nav, _super);
  68. function Nav(viewCtrl, parent, app, config, plt, elementRef, zone, renderer, cfr, gestureCtrl, transCtrl, linker, domCtrl, errHandler) {
  69. var _this = _super.call(this, parent, app, config, plt, elementRef, zone, renderer, cfr, gestureCtrl, transCtrl, linker, domCtrl, errHandler) || this;
  70. _this._hasInit = false;
  71. if (viewCtrl) {
  72. // an ion-nav can also act as an ion-page within a parent ion-nav
  73. // this would happen when an ion-nav nests a child ion-nav.
  74. viewCtrl._setContent(_this);
  75. }
  76. if (parent) {
  77. // this Nav has a parent Nav
  78. parent.registerChildNav(_this);
  79. }
  80. else if (viewCtrl && viewCtrl.getNav()) {
  81. // this Nav was opened from a modal
  82. _this.parent = viewCtrl.getNav();
  83. _this.parent.registerChildNav(_this);
  84. }
  85. else if (app && !app.getRootNavById(_this.id)) {
  86. // a root nav has not been registered yet with the app
  87. // this is the root navcontroller for the entire app
  88. app.registerRootNav(_this);
  89. }
  90. return _this;
  91. }
  92. Object.defineProperty(Nav.prototype, "_vp", {
  93. /**
  94. * @hidden
  95. */
  96. set: function (val) {
  97. this.setViewport(val);
  98. },
  99. enumerable: true,
  100. configurable: true
  101. });
  102. Nav.prototype.ngAfterViewInit = function () {
  103. var _this = this;
  104. this._hasInit = true;
  105. var segment = this._linker.getSegmentByNavIdOrName(this.id, this.name);
  106. if (segment && (segment.component || segment.loadChildren)) {
  107. return this._linker.initViews(segment).then(function (views) {
  108. return _this.setPages(views, null, null);
  109. });
  110. }
  111. else if (this._root) {
  112. // no segment match, so use the root property but don't set the url I guess
  113. var setUrl = segment ? false : true;
  114. return this.push(this._root, this.rootParams, {
  115. isNavRoot: (this._app.getRootNavById(this.id) === this),
  116. updateUrl: setUrl
  117. }, null);
  118. }
  119. };
  120. Object.defineProperty(Nav.prototype, "root", {
  121. /**
  122. * @input {Page} The Page component to load as the root page within this nav.
  123. */
  124. get: function () {
  125. return this._root;
  126. },
  127. set: function (page) {
  128. this._root = page;
  129. if (this._hasInit) {
  130. this.setRoot(page);
  131. }
  132. },
  133. enumerable: true,
  134. configurable: true
  135. });
  136. /**
  137. * @hidden
  138. */
  139. Nav.prototype.ngOnDestroy = function () {
  140. this.destroy();
  141. };
  142. Nav.prototype.initPane = function () {
  143. var isMain = this._elementRef.nativeElement.hasAttribute('main');
  144. return isMain;
  145. };
  146. Nav.prototype.paneChanged = function (isPane) {
  147. if (isPane) {
  148. this.resize();
  149. }
  150. };
  151. Nav.prototype.goToRoot = function (opts) {
  152. return this.setRoot(this._root, this.rootParams, opts, null);
  153. };
  154. /*
  155. * @private
  156. */
  157. Nav.prototype.getType = function () {
  158. return 'nav';
  159. };
  160. /*
  161. * @private
  162. */
  163. Nav.prototype.getSecondaryIdentifier = function () {
  164. return null;
  165. };
  166. Nav.decorators = [
  167. { type: core_1.Component, args: [{
  168. selector: 'ion-nav',
  169. template: '<div #viewport nav-viewport></div>' +
  170. '<div class="nav-decor"></div>',
  171. encapsulation: core_1.ViewEncapsulation.None,
  172. providers: [{ provide: split_pane_1.RootNode, useExisting: core_1.forwardRef(function () { return Nav; }) }]
  173. },] },
  174. ];
  175. /** @nocollapse */
  176. Nav.ctorParameters = function () { return [
  177. { type: view_controller_1.ViewController, decorators: [{ type: core_1.Optional },] },
  178. { type: nav_controller_1.NavController, decorators: [{ type: core_1.Optional },] },
  179. { type: app_1.App, },
  180. { type: config_1.Config, },
  181. { type: platform_1.Platform, },
  182. { type: core_1.ElementRef, },
  183. { type: core_1.NgZone, },
  184. { type: core_1.Renderer, },
  185. { type: core_1.ComponentFactoryResolver, },
  186. { type: gesture_controller_1.GestureController, },
  187. { type: transition_controller_1.TransitionController, },
  188. { type: deep_linker_1.DeepLinker, decorators: [{ type: core_1.Optional },] },
  189. { type: dom_controller_1.DomController, },
  190. { type: core_1.ErrorHandler, },
  191. ]; };
  192. Nav.propDecorators = {
  193. '_vp': [{ type: core_1.ViewChild, args: ['viewport', { read: core_1.ViewContainerRef },] },],
  194. 'root': [{ type: core_1.Input },],
  195. 'rootParams': [{ type: core_1.Input },],
  196. 'name': [{ type: core_1.Input },],
  197. };
  198. return Nav;
  199. }(nav_controller_base_1.NavControllerBase));
  200. exports.Nav = Nav;
  201. });
  202. //# sourceMappingURL=nav.js.map