This commit is contained in:
atisawd 2018-07-07 10:05:49 +05:30
parent 0474a3fddd
commit e7f92ec31e
3 changed files with 7 additions and 2 deletions

View file

@ -86,7 +86,7 @@
icons.forEach(function (iconName) {
const $div = document.createElement("div");
$div.setAttribute("class", "icon");
$div.innerHTML = `<div>${iconName}</div><box-icon type="logo" name="${iconName}"></box-icon>`;
$div.innerHTML = `<div>${iconName}</div><box-icon type="solid" name="${iconName}"></box-icon>`;
$content.appendChild($div);
});

2
dist/boxicons.js vendored

File diff suppressed because one or more lines are too long

View file

@ -154,6 +154,7 @@ export class BoxIconElement extends HTMLElement {
constructor() {
super();
this.$ui = this.attachShadow({ mode: 'open' });
this.$ui.appendChild(this.ownerDocument.importNode(TEMPLATE.content, true));
if (usingShadyCss()) {
@ -161,6 +162,7 @@ export class BoxIconElement extends HTMLElement {
}
this._state = {
$iconHolder: this.$ui.getElementById('icon'),
type: this.getAttribute('type')
};
}
@ -244,6 +246,9 @@ function handleNameChange(inst, oldVal, newVal) {
state.$iconHolder.textContent = '';
if (newVal) {
if(state.type!== undefined){
inst.constructor.getIconSvg(newVal,state.type)
.then((iconData) => {