Skip to content

Commit

Permalink
Update notiFire.js
Browse files Browse the repository at this point in the history
  • Loading branch information
dethe committed Jul 1, 2015
1 parent e0e1b98 commit 4f546a4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions js/notiFire.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* notiFire
* notiFire
* by @dongzhang
*/

Expand All @@ -26,7 +26,7 @@ function testColor(color) {
return true;
}

// notifire
// notifire
function notifire(config) {
// initialize default object
var defaults = {
Expand Down Expand Up @@ -72,7 +72,7 @@ function notifire(config) {
break;
case 'opacity':
if (typeof(config.opacity) !== 'number') console.error('invalid input opacity');
break;
break;
case 'position':
if (config.position !== 'left' && config.position !== 'right') console.error('invalid input position');
break;
Expand Down Expand Up @@ -153,7 +153,7 @@ function notifire(config) {
defaults.timeout = 'false';
}
if (!isNaN(defaults.timeout)) {
notifireDismiss(div, defaults);
var timeout = notifireDismiss(div, defaults);
}
div.addEventListener('click', function() {
if (timeout){
Expand All @@ -169,11 +169,12 @@ function notifireDismiss(div, defaults) {
if (defaults.callback !== null) {
defaults.callback();
}
setTimeout(function() {
var timeout = setTimeout(function() {
div.style['transform'] = '';
div.style['-webkit-transform'] = '';
setTimeout(function() {
wrapper.removeChild(div);
}, 500);
}, defaults.timeout);
return timeout;
}

1 comment on commit 4f546a4

@dethe
Copy link
Member Author

@dethe dethe commented on 4f546a4 Jul 1, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, first commit missed a couple of important details for clearing any existing timeout.

Please sign in to comment.