Commit 27ca01a3 authored by akiraohgaki's avatar akiraohgaki

Update chirit

parent 77416918
......@@ -16,7 +16,7 @@ export default class Component {
element = document.querySelector(element);
}
this.element = element ? element : document.createElement('div');
this.element = element || document.createElement('div');
this.innerHTML = this.element.innerHTML;
this.state = state;
......@@ -28,7 +28,7 @@ export default class Component {
_build() {
const html = this.html();
const style = this.style();
this.element.innerHTML = style ? `<style scoped>${style}</style>${html}` : html;
this.element.innerHTML = style ? `<style>${style}</style>${html}` : html;
this.script();
}
......
......@@ -15,12 +15,11 @@ export default class StatusManager {
eventTarget = document.querySelector(eventTarget);
}
this._eventTarget = eventTarget ? eventTarget : document;
this._eventTarget = eventTarget || document;
this._eventListener = (event) => {
event.preventDefault();
event.stopPropagation();
const params = event.detail ? event.detail : {};
this.dispatch(event.type, params);
this.dispatch(event.type, event.detail);
};
this._status = new Map();
......
......@@ -13,7 +13,7 @@ export default class Utility {
const params = {};
if (window.location.search.length > 1) {
const queries = window.location.search.substring(1).split('&');
for (var i = 0; i < queries.length; i++) {
for (let i = 0; i < queries.length; i++) {
const kv = queries[i].split('=');
const key = decodeURIComponent(kv[0]);
const value = kv[1] ? decodeURIComponent(kv[1]) : '';
......@@ -130,7 +130,7 @@ export default class Utility {
+ addition;
const stringArray = strings.split('');
let randomString = '';
for (var i = 0; i < length; i++) {
for (let i = 0; i < length; i++) {
randomString += stringArray[Math.floor(Math.random() * stringArray.length)];
}
return randomString;
......
{
"name": "chirit",
"version": "0.2.0",
"version": "0.2.1",
"description": "A front-end library.",
"author": "Akira Ohgaki",
"license": "BSD-2-Clause",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment