Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions vanillatoasts.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
'\tInvoke create method when DOM\s readyState is complete'
].join('\n'))
},
toasts: {} //store toasts to modify later
toasts: {}, //store toasts to modify later
autoIncrement : 0
};
var autoincrement = 0;

// Initialize library
function init() {
Expand All @@ -48,10 +48,11 @@

// @Override
// Replace create method when DOM has finished loading
VanillaToasts.toasts = {};
VanillaToasts.autoIncrement = 0;
VanillaToasts.create = function (options) {
var toast = document.createElement('div');
toast.id = ++autoincrement;
toast.id = 'toast-' + toast.id;
toast.id = `toast-${++VanillaToasts.autoIncrement}`;
toast.className = 'vanillatoasts-toast';

// title
Expand Down