picker-transitions.js 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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", "../../animations/animation", "../../transitions/transition"], factory);
  18. }
  19. })(function (require, exports) {
  20. "use strict";
  21. Object.defineProperty(exports, "__esModule", { value: true });
  22. var animation_1 = require("../../animations/animation");
  23. var transition_1 = require("../../transitions/transition");
  24. /**
  25. * Animations for pickers
  26. */
  27. var PickerSlideIn = (function (_super) {
  28. __extends(PickerSlideIn, _super);
  29. function PickerSlideIn() {
  30. return _super !== null && _super.apply(this, arguments) || this;
  31. }
  32. PickerSlideIn.prototype.init = function () {
  33. var ele = this.enteringView.pageRef().nativeElement;
  34. var backdrop = new animation_1.Animation(this.plt, ele.querySelector('ion-backdrop'));
  35. var wrapper = new animation_1.Animation(this.plt, ele.querySelector('.picker-wrapper'));
  36. backdrop.fromTo('opacity', 0.01, 0.26);
  37. wrapper.fromTo('translateY', '100%', '0%');
  38. this.easing('cubic-bezier(.36,.66,.04,1)').duration(400).add(backdrop).add(wrapper);
  39. };
  40. return PickerSlideIn;
  41. }(transition_1.Transition));
  42. exports.PickerSlideIn = PickerSlideIn;
  43. var PickerSlideOut = (function (_super) {
  44. __extends(PickerSlideOut, _super);
  45. function PickerSlideOut() {
  46. return _super !== null && _super.apply(this, arguments) || this;
  47. }
  48. PickerSlideOut.prototype.init = function () {
  49. var ele = this.leavingView.pageRef().nativeElement;
  50. var backdrop = new animation_1.Animation(this.plt, ele.querySelector('ion-backdrop'));
  51. var wrapper = new animation_1.Animation(this.plt, ele.querySelector('.picker-wrapper'));
  52. backdrop.fromTo('opacity', 0.26, 0);
  53. wrapper.fromTo('translateY', '0%', '100%');
  54. this.easing('cubic-bezier(.36,.66,.04,1)').duration(450).add(backdrop).add(wrapper);
  55. };
  56. return PickerSlideOut;
  57. }(transition_1.Transition));
  58. exports.PickerSlideOut = PickerSlideOut;
  59. });
  60. //# sourceMappingURL=picker-transitions.js.map