Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

lift-animator.js 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of';
  2. import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
  3. import _createClass from 'babel-runtime/helpers/createClass';
  4. import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
  5. import _inherits from 'babel-runtime/helpers/inherits';
  6. /*
  7. Copyright 2013-2015 ASIAL CORPORATION
  8. Licensed under the Apache License, Version 2.0 (the "License");
  9. you may not use this file except in compliance with the License.
  10. You may obtain a copy of the License at
  11. http://www.apache.org/licenses/LICENSE-2.0
  12. Unless required by applicable law or agreed to in writing, software
  13. distributed under the License is distributed on an "AS IS" BASIS,
  14. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. See the License for the specific language governing permissions and
  16. limitations under the License.
  17. */
  18. import animit from '../../ons/animit';
  19. import ModalAnimator from './animator';
  20. /**
  21. * iOS style animator for modal.
  22. */
  23. var LiftModalAnimator = function (_ModalAnimator) {
  24. _inherits(LiftModalAnimator, _ModalAnimator);
  25. function LiftModalAnimator() {
  26. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  27. _ref$timing = _ref.timing,
  28. timing = _ref$timing === undefined ? 'cubic-bezier( .1, .7, .1, 1)' : _ref$timing,
  29. _ref$delay = _ref.delay,
  30. delay = _ref$delay === undefined ? 0 : _ref$delay,
  31. _ref$duration = _ref.duration,
  32. duration = _ref$duration === undefined ? 0.4 : _ref$duration;
  33. _classCallCheck(this, LiftModalAnimator);
  34. return _possibleConstructorReturn(this, (LiftModalAnimator.__proto__ || _Object$getPrototypeOf(LiftModalAnimator)).call(this, { timing: timing, delay: delay, duration: duration }));
  35. }
  36. /**
  37. * @param {HTMLElement} modal
  38. * @param {Function} callback
  39. */
  40. _createClass(LiftModalAnimator, [{
  41. key: 'show',
  42. value: function show(modal, callback) {
  43. callback = callback ? callback : function () {};
  44. animit(modal, this.def).default({ transform: 'translate3d(0, 100%, 0)' }, { transform: 'translate3d(0, 0, 0)' }).queue(function (done) {
  45. callback();
  46. done();
  47. }).play();
  48. }
  49. /**
  50. * @param {HTMLElement} modal
  51. * @param {Function} callback
  52. */
  53. }, {
  54. key: 'hide',
  55. value: function hide(modal, callback) {
  56. callback = callback ? callback : function () {};
  57. animit(modal, this.def).default({ transform: 'translate3d(0, 0, 0)' }, { transform: 'translate3d(0, 100%, 0)' }).queue(function (done) {
  58. callback();
  59. done();
  60. }).play();
  61. }
  62. }]);
  63. return LiftModalAnimator;
  64. }(ModalAnimator);
  65. export default LiftModalAnimator;