From 552cde76fa96282dec4ba002cd1850d003a5b29f Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Wed, 6 Apr 2016 15:06:27 +0100 Subject: [PATCH] Hides notification after X amount of seconds --- app/assets/javascripts/lib/notify.js.coffee | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/assets/javascripts/lib/notify.js.coffee b/app/assets/javascripts/lib/notify.js.coffee index 3f9ca39912c..9e28353ac34 100644 --- a/app/assets/javascripts/lib/notify.js.coffee +++ b/app/assets/javascripts/lib/notify.js.coffee @@ -2,6 +2,11 @@ notificationGranted = (message, opts, onclick) -> notification = new Notification(message, opts) + # Hide the notification after X amount of seconds + setTimeout -> + notification.close() + , 8000 + if onclick notification.onclick = onclick