Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

createIconMap returns lots of non-icons when a complex icon contains paths with ids #41

@danishdynamite

Description

@danishdynamite

I was writing a demo page for a custom iconset and was puzzled when it returned lots of stuff that was not icons at all.

It turns out the selector just looks for any element with an id-attribute, and I think that's a bit too lax. After I adjusted it to defs > g[id], it worked as I had expected it to, but then again, I don't know if this may ruin other stuff. Any comments?

    _createIconMap: function() {
      var icons = Object.create(null);
      Polymer.dom(this).querySelectorAll('defs > g[id]')
        .forEach(function(icon) {
          icons[icon.id] = icon;
        });
      return icons;
    },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions