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.

30 lines
795 B

  1. /**
  2. A control that displays an icon. The icon image is specified by setting the
  3. *src* property to a URL.
  4. In onyx, icons have a size of 32x32 pixels. Since the icon image is applied
  5. as a CSS background, the height and width of an icon must be set if an image
  6. of a different size is used.
  7. {kind: "onyx.Icon", src: "images/search.png"}
  8. When an icon should act like a button, use an <a href="#onyx.IconButton">onyx.IconButton</a>.
  9. */
  10. enyo.kind({
  11. name: "onyx.Icon",
  12. published: {
  13. // url path specifying the icon image
  14. src: ""
  15. },
  16. classes: "onyx-icon",
  17. //* @protected
  18. create: function() {
  19. this.inherited(arguments);
  20. if (this.src) {
  21. this.srcChanged();
  22. }
  23. },
  24. srcChanged: function() {
  25. this.applyStyle("background-image", "url(" + enyo.path.rewrite(this.src) + ")");
  26. }
  27. });