SlideTransitionController.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. 'use strict';
  2. /**
  3. * Licensed Materials - Property of IBM
  4. * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2014, 2017
  5. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  6. */
  7. define(['../TransitionController', '../../util/AnimationHelper'], function (BaseClass, AnimationHelper) {
  8. var SlideTransitionController = BaseClass.extend({
  9. _duration: null,
  10. _cssOnScreen: {
  11. display: 'block',
  12. transform: 'scale(1)',
  13. position: 'absolute',
  14. top: '0px',
  15. bottom: '0px',
  16. left: '0px',
  17. right: '0px'
  18. },
  19. init: function init(options) {
  20. SlideTransitionController.inherited('init', this, arguments);
  21. this._duration = options.duration ? options.duration : 800;
  22. },
  23. _beforeJump: function _beforeJump(from) {
  24. this._hideWidgets(from);
  25. return SlideTransitionController.inherited('_beforeJump', this, arguments);
  26. },
  27. _jump: function _jump(from, to) {
  28. if (from && from.$el) {
  29. from.$el.css({
  30. transform: AnimationHelper.SCALE_ZERO
  31. }).attr('aria-hidden', 'true');
  32. }
  33. to.$el.css(this._cssOnScreen).css({ opacity: 1 }).addClass('selected').attr('aria-hidden', 'false');
  34. return SlideTransitionController.inherited('_jump', this, arguments);
  35. },
  36. _afterJump: function _afterJump(from, to) {
  37. this._showWidgets(to);
  38. return SlideTransitionController.inherited('_afterJump', this, arguments);
  39. }
  40. });
  41. return SlideTransitionController;
  42. });
  43. //# sourceMappingURL=SlideTransitionController.js.map