UndoAction.js 1018 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| IBM Cognos Products: Viewer
  5. *| (C) Copyright IBM Corp. 2001, 2011
  6. *|
  7. *| US Government Users Restricted Rights - Use, duplication or
  8. *| disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  9. *|
  10. *+------------------------------------------------------------------------+
  11. */
  12. function UndoAction()
  13. {
  14. this.m_sAction = "Undo";
  15. }
  16. UndoAction.prototype = new UndoRedoAction();
  17. UndoAction.prototype.updateMenu = function(jsonSpec)
  18. {
  19. jsonSpec.visible = this.getCognosViewer().isLimitedInteractiveMode() ? true : this.ifContainsInteractiveDataContainer();
  20. if (! jsonSpec.visible)
  21. {
  22. return jsonSpec;
  23. }
  24. if (this.getUndoRedoQueue().getPosition() > 0)
  25. {
  26. jsonSpec.iconClass = "undo";
  27. jsonSpec.disabled = false;
  28. }
  29. else
  30. {
  31. jsonSpec.iconClass = "undoDisabled";
  32. jsonSpec.disabled = true;
  33. }
  34. jsonSpec.label = this.getUndoRedoQueue().getUndoTooltip();
  35. return jsonSpec;
  36. };