a zip code crypto-currency system good for red ONLY

modal-impl.js 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import { isPresent } from '../../util/util';
  2. import { PORTAL_MODAL } from '../app/app-constants';
  3. import { ModalCmp } from './modal-component';
  4. import { ModalMDSlideIn, ModalMDSlideOut, ModalSlideIn, ModalSlideOut } from './modal-transitions';
  5. import { ViewController } from '../../navigation/view-controller';
  6. /**
  7. * @hidden
  8. */
  9. export class ModalImpl extends ViewController {
  10. constructor(app, component, data, opts = {}, config) {
  11. data = data || {};
  12. data.component = component;
  13. opts.showBackdrop = isPresent(opts.showBackdrop) ? !!opts.showBackdrop : true;
  14. opts.enableBackdropDismiss = isPresent(opts.enableBackdropDismiss) ? !!opts.enableBackdropDismiss : true;
  15. data.opts = opts;
  16. super(ModalCmp, data, null);
  17. this._app = app;
  18. this._enterAnimation = opts.enterAnimation;
  19. this._leaveAnimation = opts.leaveAnimation;
  20. this.isOverlay = true;
  21. config.setTransition('modal-slide-in', ModalSlideIn);
  22. config.setTransition('modal-slide-out', ModalSlideOut);
  23. config.setTransition('modal-md-slide-in', ModalMDSlideIn);
  24. config.setTransition('modal-md-slide-out', ModalMDSlideOut);
  25. }
  26. /**
  27. * @hidden
  28. */
  29. getTransitionName(direction) {
  30. let key;
  31. if (direction === 'back') {
  32. if (this._leaveAnimation) {
  33. return this._leaveAnimation;
  34. }
  35. key = 'modalLeave';
  36. }
  37. else {
  38. if (this._enterAnimation) {
  39. return this._enterAnimation;
  40. }
  41. key = 'modalEnter';
  42. }
  43. return this._nav && this._nav.config.get(key);
  44. }
  45. /**
  46. * Present the action sheet instance.
  47. *
  48. * @param {NavOptions} [navOptions={}] Nav options to go with this transition.
  49. * @returns {Promise} Returns a promise which is resolved when the transition has completed.
  50. */
  51. present(navOptions = {}) {
  52. navOptions.minClickBlockDuration = navOptions.minClickBlockDuration || 400;
  53. return this._app.present(this, navOptions, PORTAL_MODAL);
  54. }
  55. }
  56. //# sourceMappingURL=modal-impl.js.map