ui.toolbar.strategy.action_sheet.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * DevExtreme (ui/toolbar/ui.toolbar.strategy.action_sheet.js)
  3. * Version: 19.1.16
  4. * Build date: Tue Oct 18 2022
  5. *
  6. * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
  7. * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
  8. */
  9. "use strict";
  10. var ToolbarStrategy = require("./ui.toolbar.strategy");
  11. var extend = require("../../core/utils/extend").extend;
  12. var ActionSheet = require("../action_sheet");
  13. var ActionSheetStrategy = ToolbarStrategy.inherit({
  14. NAME: "actionSheet",
  15. _getMenuItemTemplate: function() {
  16. return this._toolbar._getTemplate("actionSheetItem")
  17. },
  18. render: function() {
  19. if (!this._hasVisibleMenuItems()) {
  20. return
  21. }
  22. this.callBase()
  23. },
  24. _menuWidgetClass: function() {
  25. return ActionSheet
  26. },
  27. _menuContainer: function() {
  28. return this._toolbar.$element()
  29. },
  30. _widgetOptions: function() {
  31. return extend({}, this.callBase(), {
  32. target: this._$button,
  33. showTitle: false
  34. })
  35. },
  36. _menuButtonOptions: function() {
  37. return extend({}, this.callBase(), {
  38. icon: "overflow"
  39. })
  40. },
  41. _toggleMenu: function() {
  42. this.callBase.apply(this, arguments);
  43. this._menu.toggle(this._menuShown);
  44. this._menuShown = false
  45. }
  46. });
  47. module.exports = ActionSheetStrategy;