Skip to content

Commit

Permalink
Allow click to dismiss
Browse files Browse the repository at this point in the history
I want to be able to click-to-dismiss even if there is a timeout. This allows slower readers to have time to see the message, but faster readers can get on with what they're doing.
  • Loading branch information
dethe committed Jul 1, 2015
1 parent aa23601 commit e0e1b98
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions js/notiFire.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,14 @@ function notifire(config) {
}
if (!isNaN(defaults.timeout)) {
notifireDismiss(div, defaults);
} else {
div.addEventListener('click', function() {notifireDismiss(div, defaults);});
}
div.addEventListener('click', function() {
if (timeout){
clearTimeout(timeout);
}
defaults.timeout = 0;
notifireDismiss(div, defaults);
});
}

// dismiss notifire
Expand All @@ -171,4 +176,4 @@ function notifireDismiss(div, defaults) {
wrapper.removeChild(div);
}, 500);
}, defaults.timeout);
}
}

0 comments on commit e0e1b98

Please sign in to comment.