diff options
Diffstat (limited to 'notif/notif.ts')
| -rw-r--r-- | notif/notif.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/notif/notif.ts b/notif/notif.ts index 8bc5d84..23933ab 100644 --- a/notif/notif.ts +++ b/notif/notif.ts @@ -6,7 +6,7 @@ export const WUI_NOTIF_CLASS_INFO = "wui_notif_info"; export const WUI_NOTIF_CLASS_ERROR = "wui_notif_error"; // WuiNotif implement the HTML interface to display pop-up notification. -// The notification can be triggered by calling method Info() or Error(). +// The notification can be triggered by calling method info() or error(). // Each pop-up has 5 seconds duration, after that they will be removed // automatically. export class WuiNotif { @@ -22,9 +22,9 @@ export class WuiNotif { this.initStyle(); } - // Info show the msg as information. - Info(msg: string) { - let item = document.createElement("div"); + // info show the msg as information. + info(msg: string) { + const item = document.createElement("div"); item.innerHTML = msg; item.classList.add(WUI_NOTIF_CLASS_INFO); this.el.appendChild(item); @@ -34,9 +34,9 @@ export class WuiNotif { }, this.timeout); } - // Info show the msg as an error. - Error(msg: string) { - let item = document.createElement("div"); + // error show the msg as an error. + error(msg: string) { + const item = document.createElement("div"); item.innerHTML = msg; item.classList.add(WUI_NOTIF_CLASS_ERROR); this.el.appendChild(item); @@ -47,7 +47,7 @@ export class WuiNotif { } private initStyle() { - let style = document.createElement("style"); + const style = document.createElement("style"); style.type = "text/css"; style.innerText = ` #${WUI_NOTIF_ID} { |
