How to use the elm.so.Icon function in elm

To help you get started, we’ve selected a few elm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shr-project / enlightenment / PROTO / easyui / eui.js View on Github external
default:
          return elm.Button({
            label: item,
            on_click: this.selectedNavigationBarItem.bind(this, item)
          });
      }
    }

    if (item instanceof Controller) {
      var btn = elm.Button({});

      if (item.title)
        btn.label = item.title;

      if (item.icon)
        btn.icon = elm.Icon({ image: item.icon });

      switch (item) {
        case this.parent:
          btn.on_click = this.popController.bind(this);
          break;
        case this.split.left:
          if (EUI.uiMode === 'tablet')
            return;
          btn.icon = btn.icon || elm.Icon({ image: 'apps' });
          btn.on_click = function() { this.split.leftPanelVisible = true }.bind(this);
          break;
        default:
          btn.on_click = this.selectedNavigationBarItem.bind(this, item);
      }

      return btn;
github shr-project / enlightenment / PROTO / easyui / eui.js View on Github external
var btn = elm.Button({});

      if (item.title)
        btn.label = item.title;

      if (item.icon)
        btn.icon = elm.Icon({ image: item.icon });

      switch (item) {
        case this.parent:
          btn.on_click = this.popController.bind(this);
          break;
        case this.split.left:
          if (EUI.uiMode === 'tablet')
            return;
          btn.icon = btn.icon || elm.Icon({ image: 'apps' });
          btn.on_click = function() { this.split.leftPanelVisible = true }.bind(this);
          break;
        default:
          btn.on_click = this.selectedNavigationBarItem.bind(this, item);
      }

      return btn;
    }

    if (typeof(item) === 'object' && item.hasOwnProperty('label')) {
      item.on_click = item.on_click || this.selectedNavigationBarItem.bind(this, item);
      return elm.Button(item);
    }

    return item;
  },
github shr-project / enlightenment / PROTO / easyui / eui.js View on Github external
content: function() {
                return elm.Icon({ image: 'refresh' });
              }
            },
github shr-project / enlightenment / PROTO / easyui / eui.js View on Github external
content: function(part, data) {
                if (part == 'elm.swallow.end')
                  return elm.Button({ label: "Delete"});
                var item = this._itemFromData(data.data);
                var image = item && item[part.replace('elm.swallow.', '')];
                return image &&  elm.Icon({ image: image });
              }.bind(this),
              state: function(part, data) {