diff --git a/js/gittip/notification.js b/js/gittip/notification.js index 54bff14d49..a0b9c294ac 100644 --- a/js/gittip/notification.js +++ b/js/gittip/notification.js @@ -3,8 +3,9 @@ * @param {string} text Notification text * @param {string} [type=notice] Notofication type (one of: notice, error, success) */ -Gittip.notification = function(text, type) { - type = type || 'notice'; +Gittip.notification = function(text, type, timeout) { + var type = type || 'notice'; + var timeout = timeout || 10000; var dialog = ['div', { 'class': 'notification notification-' + type }, [ 'div', text ]]; var $dialog = $([ @@ -23,5 +24,5 @@ Gittip.notification = function(text, type) { } $dialog.on('click', fadeOut); - setTimeout(fadeOut, 5000); + if (timeout > 0) setTimeout(fadeOut, timeout); }; diff --git a/templates/base.html b/templates/base.html index 5d53bb24cb..bd696a8f52 100644 --- a/templates/base.html +++ b/templates/base.html @@ -128,11 +128,17 @@