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.

38 lines
1.0 KiB

  1. /**
  2. An icon that acts like a button. The icon image is specified by setting the
  3. *src* property to a URL.
  4. {kind: "onyx.IconButton", src: "images/search.png", ontap: "buttonTap"}
  5. If you want to combine an icon with text inside a button, use an
  6. <a href="#onyx.Icon">onyx.Icon</a> inside an
  7. <a href="#onyx.Button">onyx.Button</a>, e.g.:
  8. {kind: "onyx.Button", ontap: "buttonTap", components: [
  9. {kind: "onyx.Icon", src: "images/search.png"},
  10. {content: "Button"}
  11. ]}
  12. The image associated with the *src* property of the IconButton is assumed
  13. to be 32x64-pixel strip with the top half showing the button's normal state
  14. and the bottom half showing its state when hovered-over or active.
  15. */
  16. enyo.kind({
  17. name: "onyx.IconButton",
  18. kind: "onyx.Icon",
  19. published: {
  20. active: false
  21. },
  22. classes: "onyx-icon-button",
  23. //* @protected
  24. rendered: function() {
  25. this.inherited(arguments);
  26. this.activeChanged();
  27. },
  28. tap: function() {
  29. this.setActive(true);
  30. },
  31. activeChanged: function() {
  32. this.bubble("onActivate");
  33. }
  34. });