ToggleMenuBar.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. 'use strict';
  2. /*
  3. *+------------------------------------------------------------------------+
  4. *| Licensed Materials - Property of IBM
  5. *| IBM Cognos Products: Content Explorer
  6. *| (C) Copyright IBM Corp. 2015, 2017
  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(['jquery', 'bi/admin/common/ui/GeminiToggleMenuBar', 'bi/commons/utils/Utils'], function ($, GeminiToggleMenuBar, Utils) {
  13. var ToggleMenuBar = null;
  14. /**
  15. * Represents a drop down menu that can be added to an app bar
  16. */
  17. ToggleMenuBar = GeminiToggleMenuBar.extend({
  18. events: {
  19. 'clicktap .dropdown-toggle': '_handleClick',
  20. 'clicktap .dropdown-menuitem': '_handleClick',
  21. 'keydown': '_handleKeyboard'
  22. },
  23. render: function render() {
  24. ToggleMenuBar.inherited('render', this, arguments);
  25. if (this.icon) {
  26. if (this.iconRightAlign) {
  27. this.$toggle.append(this.$iconImage);
  28. }
  29. if (this.bSVG) {
  30. Utils.setIcon(this.$iconImage, this.icon);
  31. }
  32. }
  33. }
  34. });
  35. return ToggleMenuBar;
  36. });