From c0eb82f55a40f64025800c0ad2b6a05290576337 Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Tue, 19 Dec 2017 14:21:29 +0530 Subject: Now supports * type arguments, * positional parameters and * html as content * Documentation updates --- src/vanilla.yo.notification.ts | 76 ------------------------------------------ 1 file changed, 76 deletions(-) delete mode 100644 src/vanilla.yo.notification.ts (limited to 'src/vanilla.yo.notification.ts') diff --git a/src/vanilla.yo.notification.ts b/src/vanilla.yo.notification.ts deleted file mode 100644 index 7b50804..0000000 --- a/src/vanilla.yo.notification.ts +++ /dev/null @@ -1,76 +0,0 @@ -// Import stylesheets -import './styles/style.css'; -import { Config } from './config.interface'; - -export default class VanillaYoNotification { - - private notificationTemplate: string; - private defaultConfig: Config; - private notifInner: any; - - constructor() { - this.defaultConfig = { - content: '', - footer: '', - timeout: 3000, - title: '' - } - this.init(); - } - - private init() { - - this.buildContainers(); - - - } - - buildContainers(){ - let container = document.createElement('div'); - container.className = "notif-mainContainer topRight"; - - this.notifInner = document.createElement('div'); - this.notifInner.className = "notif-inner"; - - container.appendChild(this.notifInner); - document.body.appendChild(container); - } - - - show(config: Config) { - - let notifContainer = document.createElement('div'); - notifContainer.className = "vanilla-yo-notification"; - - - this.notificationTemplate = ` -
-
- ${config.title ? config.title : this.defaultConfig.title} -
-
- ${config.content ? config.content : this.defaultConfig.content} -
- -
- `; - - notifContainer.innerHTML = (this.notificationTemplate); - - this.notifInner.appendChild(notifContainer); - - - setTimeout(() => { - this.destroyNotification(notifContainer); - }, (config.timeout ? config.timeout : this.defaultConfig.timeout)); - - - } - - private destroyNotification(container: Node) { - this.notifInner.removeChild(container); - } -} - -- cgit v1.2.3