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