PanAndZoomTransitionController.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. 'use strict';
  2. /**
  3. * Licensed Materials - Property of IBM
  4. * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2015, 2017
  5. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  6. */
  7. define(['../TransitionController'], function (BaseClass) {
  8. 'use strict';
  9. var PanAndZoomTransitionController = PanAndZoomTransitionController = BaseClass.extend({
  10. _duration: null,
  11. _cssOnScreen: {
  12. display: 'block',
  13. position: 'absolute',
  14. top: '0px',
  15. bottom: '0px',
  16. left: '0px',
  17. right: '0px'
  18. },
  19. init: function init(options) {
  20. PanAndZoomTransitionController.inherited('init', this, arguments);
  21. this._duration = options.duration ? options.duration : 800;
  22. this._impress = options.impress;
  23. },
  24. _beforeJump: function _beforeJump(from) {
  25. this._hideWidgets(from);
  26. return PanAndZoomTransitionController.inherited('_beforeJump', this, arguments);
  27. },
  28. _afterJump: function _afterJump(from, to) {
  29. this._showWidgets(to);
  30. return PanAndZoomTransitionController.inherited('_afterJump', this, arguments);
  31. },
  32. _jump: function _jump(from, to) {
  33. this._impress.goto(to.$el[0].id);
  34. return PanAndZoomTransitionController.inherited('_jump', this, arguments);
  35. },
  36. _beforeNext: function _beforeNext(from, to) {
  37. this._showWidgets(to);
  38. return PanAndZoomTransitionController.inherited('_beforeNext', this, arguments);
  39. },
  40. _next: function _next(from, to) {
  41. this._impress.goto(to.$el[0].id);
  42. return Promise.resolve();
  43. },
  44. _afterNext: function _afterNext(from /*, to*/) {
  45. this._hideWidgets(from);
  46. return PanAndZoomTransitionController.inherited('_afterNext', this, arguments);
  47. },
  48. _beforePrevious: function _beforePrevious(from, to) {
  49. this._showWidgets(to);
  50. return PanAndZoomTransitionController.inherited('_beforePrevious', this, arguments);
  51. },
  52. _previous: function _previous(from, to) {
  53. this._impress.goto(to.$el[0].id);
  54. return Promise.resolve();
  55. },
  56. _afterPrevious: function _afterPrevious(from) {
  57. this._hideWidgets(from);
  58. return PanAndZoomTransitionController.inherited('_afterPrevious', this, arguments);
  59. },
  60. deckScenes: function deckScenes() {},
  61. undeckScenes: function undeckScenes() {}
  62. });
  63. return PanAndZoomTransitionController;
  64. });
  65. //# sourceMappingURL=PanAndZoomTransitionController.js.map