not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.1 KiB

  1. /**
  2. _MenuItem_ is a button styled to look like a menu item, intended for use in
  3. an <a href="#onyx.Menu">onyx.Menu</a>. When the MenuItem is tapped, it
  4. tells the menu to hide itself and sends an _onSelect_ event with its
  5. content and a reference to itself. This event and its properties may be
  6. received by a client application to determine which menu item was selected.
  7. enyo.kind({
  8. handlers: {
  9. onSelect: "itemSelected"
  10. },
  11. components: [
  12. {kind: "onyx.MenuDecorator", components: [
  13. {content: "Open Menu (floating)"},
  14. {kind: "onyx.Menu", floating: true, components: [
  15. {content: "1"},
  16. {content: "2"},
  17. {classes: "onyx-menu-divider"},
  18. {content: "3"},
  19. ]}
  20. ]}
  21. ],
  22. itemSelected: function(inSender, inEvent) {
  23. enyo.log("Menu Item Selected: " + inEvent.originator.content);
  24. }
  25. })
  26. */
  27. enyo.kind({
  28. name: "onyx.MenuItem",
  29. kind: "enyo.Button",
  30. tag: "div",
  31. classes: "onyx-menu-item",
  32. events: {
  33. onSelect: ""
  34. },
  35. tap: function(inSender) {
  36. this.inherited(arguments);
  37. this.bubble("onRequestHideMenu");
  38. this.doSelect({selected:this, content:this.content});
  39. }
  40. });