DownloadLanguageActionHandler.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. 'use strict';
  2. /*
  3. *+------------------------------------------------------------------------+
  4. *| Licensed Materials - Property of IBM
  5. *| IBM Cognos Products: Content Explorer
  6. *| (C) Copyright IBM Corp. 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(['../../../lib/@waca/core-client/js/core-client/ui/core/Class'], function (BaseClass) {
  13. 'use strict';
  14. var ActionHandler = BaseClass.extend({
  15. /**
  16. * Menu item handler
  17. */
  18. onSelectItem: function onSelectItem(context) {
  19. var info = context.target.activeObject;
  20. info.translationService.downloadTranslations(info.selectedLocale);
  21. },
  22. /**
  23. * Determine when we show/hide the menu item
  24. */
  25. isItemVisible: function isItemVisible(options) {
  26. var info = options.target.activeObject;
  27. var defaultLanguage = info.translationService.getDefaultLanguage();
  28. return defaultLanguage === info.selectedLocale;
  29. }
  30. });
  31. return ActionHandler;
  32. });
  33. //# sourceMappingURL=DownloadLanguageActionHandler.js.map