GlassUtil.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. "use strict";
  2. /*
  3. *+------------------------------------------------------------------------+
  4. *| Licensed Materials - Property of IBM
  5. *| IBM Cognos Products: dashboard
  6. *| (C) Copyright IBM Corp. 2016, 2018
  7. *|
  8. *| US Government Users Restricted Rights - Use, duplication or disclosure
  9. *| restricted by GSA ADP Schedule Contract with IBM Corp.
  10. *+------------------------------------------------------------------------+
  11. */
  12. define([], function () {
  13. return {
  14. isStoryMode: function isStoryMode(glassContext) {
  15. if (glassContext.appController.currentAppView.currentContentView) {
  16. return glassContext.appController.currentAppView.currentContentView.isStoryMode === true;
  17. }
  18. return glassContext.appController.currentAppView.defaultContent.isStoryMode === true;
  19. },
  20. /** Returns true if we're in 'development' mode, false otherwise. */
  21. isDevMode: function isDevMode(services) {
  22. if (services && services.biGlass && services.biGlass.glassContext && services.biGlass.glassContext.isDevInstall) {
  23. return services.biGlass.glassContext.isDevInstall();
  24. }
  25. return false;
  26. },
  27. getAjaxService: function getAjaxService(glassContext) {
  28. return glassContext.services.ajax;
  29. }
  30. };
  31. });
  32. //# sourceMappingURL=GlassUtil.js.map