a zip code crypto-currency system good for red ONLY

loading-component.js 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. import { Component, ElementRef, HostListener, Renderer, ViewEncapsulation } from '@angular/core';
  2. import { Config } from '../../config/config';
  3. import { BLOCK_ALL, GestureController } from '../../gestures/gesture-controller';
  4. import { isDefined, isUndefined } from '../../util/util';
  5. import { KEY_ESCAPE } from '../../platform/key';
  6. import { NavParams } from '../../navigation/nav-params';
  7. import { ViewController } from '../../navigation/view-controller';
  8. /**
  9. * @hidden
  10. */
  11. var LoadingCmp = (function () {
  12. function LoadingCmp(_viewCtrl, _config, _elementRef, gestureCtrl, params, renderer) {
  13. this._viewCtrl = _viewCtrl;
  14. this._config = _config;
  15. (void 0) /* assert */;
  16. this.gestureBlocker = gestureCtrl.createBlocker(BLOCK_ALL);
  17. this.d = params.data;
  18. renderer.setElementClass(_elementRef.nativeElement, "loading-" + _config.get('mode'), true);
  19. if (this.d.cssClass) {
  20. this.d.cssClass.split(' ').forEach(function (cssClass) {
  21. // Make sure the class isn't whitespace, otherwise it throws exceptions
  22. if (cssClass.trim() !== '')
  23. renderer.setElementClass(_elementRef.nativeElement, cssClass, true);
  24. });
  25. }
  26. this.id = (++loadingIds);
  27. }
  28. LoadingCmp.prototype.ngOnInit = function () {
  29. // If no spinner was passed in loading options we need to fall back
  30. // to the loadingSpinner in the app's config, then the mode spinner
  31. if (isUndefined(this.d.spinner)) {
  32. this.d.spinner = this._config.get('loadingSpinner', this._config.get('spinner', 'ios'));
  33. }
  34. // If the user passed hide to the spinner we don't want to show it
  35. this.showSpinner = isDefined(this.d.spinner) && this.d.spinner !== 'hide';
  36. };
  37. LoadingCmp.prototype.ionViewWillEnter = function () {
  38. this.gestureBlocker.block();
  39. };
  40. LoadingCmp.prototype.ionViewDidLeave = function () {
  41. this.gestureBlocker.unblock();
  42. };
  43. LoadingCmp.prototype.ionViewDidEnter = function () {
  44. var _this = this;
  45. // If there is a duration, dismiss after that amount of time
  46. if (this.d && this.d.duration) {
  47. this.durationTimeout = setTimeout(function () { return _this.dismiss('backdrop'); }, this.d.duration);
  48. }
  49. };
  50. LoadingCmp.prototype.keyUp = function (ev) {
  51. if (this._viewCtrl.isLast() && ev.keyCode === KEY_ESCAPE) {
  52. this.bdClick();
  53. }
  54. };
  55. LoadingCmp.prototype.bdClick = function () {
  56. if (this.d.enableBackdropDismiss) {
  57. this.dismiss('backdrop');
  58. }
  59. };
  60. LoadingCmp.prototype.dismiss = function (role) {
  61. if (this.durationTimeout) {
  62. clearTimeout(this.durationTimeout);
  63. }
  64. return this._viewCtrl.dismiss(null, role);
  65. };
  66. LoadingCmp.prototype.ngOnDestroy = function () {
  67. (void 0) /* assert */;
  68. this.gestureBlocker.destroy();
  69. };
  70. LoadingCmp.decorators = [
  71. { type: Component, args: [{
  72. selector: 'ion-loading',
  73. template: '<ion-backdrop [hidden]="!d.showBackdrop" (click)="bdClick()" [class.backdrop-no-tappable]="!d.enableBackdropDismiss"></ion-backdrop>' +
  74. '<div class="loading-wrapper">' +
  75. '<div *ngIf="showSpinner" class="loading-spinner">' +
  76. '<ion-spinner [name]="d.spinner"></ion-spinner>' +
  77. '</div>' +
  78. '<div *ngIf="d.content" [innerHTML]="d.content" class="loading-content"></div>' +
  79. '</div>',
  80. host: {
  81. 'role': 'dialog'
  82. },
  83. encapsulation: ViewEncapsulation.None,
  84. },] },
  85. ];
  86. /** @nocollapse */
  87. LoadingCmp.ctorParameters = function () { return [
  88. { type: ViewController, },
  89. { type: Config, },
  90. { type: ElementRef, },
  91. { type: GestureController, },
  92. { type: NavParams, },
  93. { type: Renderer, },
  94. ]; };
  95. LoadingCmp.propDecorators = {
  96. 'keyUp': [{ type: HostListener, args: ['body:keyup', ['$event'],] },],
  97. };
  98. return LoadingCmp;
  99. }());
  100. export { LoadingCmp };
  101. var loadingIds = -1;
  102. //# sourceMappingURL=loading-component.js.map