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.

44 lines
940 B

  1. // Class for a Sugar button with an icon and a text
  2. enyo.kind({
  3. name: "Sugar.IconButton",
  4. kind: enyo.Control,
  5. published: {
  6. icon: null,
  7. text: null,
  8. colorized: false,
  9. colorizedColor: null,
  10. },
  11. classes: "icon-button",
  12. components: [
  13. { name: "icon", kind: "Sugar.Icon", size: 20, x: 6, y: 6},
  14. { name: "text", classes: "icon-button-text" }
  15. ],
  16. // Constructor
  17. create: function() {
  18. this.inherited(arguments);
  19. this.iconChanged();
  20. this.textChanged();
  21. this.colorizedChanged();
  22. if (l10n.language.direction == "rtl") {
  23. this.setAttribute("dir", "rtl");
  24. this.$.text.addClass("rtl-10");
  25. }
  26. },
  27. // Property changed
  28. iconChanged: function() {
  29. this.$.icon.setIcon(this.icon);
  30. },
  31. textChanged: function() {
  32. this.$.text.setContent(this.text);
  33. },
  34. colorizedChanged: function() {
  35. if (this.colorized) {
  36. this.$.icon.setColorized(this.colorized);
  37. this.$.icon.setColorizedColor(this.colorizedColor);
  38. }
  39. },
  40. });