NoTransitionSlideShowTransitionController.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. 'use strict';
  2. /**
  3. * Licensed Materials - Property of IBM
  4. * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 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 NoTransitionSlideShowTransitionController = 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. NoTransitionSlideShowTransitionController.inherited('init', this, arguments);
  21. this._duration = options.duration ? options.duration : 100;
  22. },
  23. _beforeJump: function _beforeJump(from) {
  24. this._hideWidgets(from);
  25. return NoTransitionSlideShowTransitionController.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 NoTransitionSlideShowTransitionController.inherited('_jump', this, arguments);
  35. },
  36. _afterJump: function _afterJump(from, to) {
  37. this._showWidgets(to);
  38. return NoTransitionSlideShowTransitionController.inherited('_afterJump', this, arguments);
  39. },
  40. _beforeNext: function _beforeNext() /*from, to*/{
  41. return NoTransitionSlideShowTransitionController.inherited('_beforeNext', this, arguments);
  42. },
  43. _next: function _next(from, to) {
  44. return this._jump(from, to);
  45. },
  46. _afterNext: function _afterNext(from, to) {
  47. return this._afterJump(from, to);
  48. },
  49. _beforePrevious: function _beforePrevious(from, to) {
  50. return this._beforeJump(from, to);
  51. },
  52. _previous: function _previous(from, to) {
  53. return this._jump(from, to);
  54. },
  55. _afterPrevious: function _afterPrevious(from, to) {
  56. return this._afterJump(from, to);
  57. }
  58. });
  59. return NoTransitionSlideShowTransitionController;
  60. });
  61. //# sourceMappingURL=NoTransitionSlideShowTransitionController.js.map