Skip to content

Node.js based forum software built for the modern web

fixes #17

Baris Soner Usakli1620d1e4be44
diff --git a/public/src/app.js b/public/src/app.js
index 274f3d7c3f..93d5bbd181 100644
--- a/public/src/app.js
+++ b/public/src/app.js
@@ -107,10 +107,23 @@ var socket,
var alert = $('#'+alert_id);
+ function startTimeout(div, timeout) {
+ var timeoutId = setTimeout(function() {
+ $(div).fadeOut(1000, function() {
+ this.remove();
+ });
+ }, timeout);
+
+ $(div).attr('timeoutId', timeoutId);
+ }
+
if(alert.length > 0) {
alert.find('strong').html(params.title);
alert.find('p').html(params.message);
alert.attr('class', "alert toaster-alert " + ((params.type=='warning') ? '' : "alert-" + params.type));
+
+ clearTimeout(alert.attr('timeoutId'));
+ startTimeout(alert, params.timeout);
}
else {
var div = document.createElement('div'),
@@ -140,11 +153,7 @@ var socket,
jQuery('#'+params.location).prepend(jQuery(div).fadeIn('100'));
if (params.timeout) {
- setTimeout(function() {
- jQuery(div).fadeOut(1000, function() {
- this.remove();
- });
- }, params.timeout)
+ startTimeout(div, params.timeout);
}
if (params.clickfn) {
@@ -158,6 +167,8 @@ var socket,
}
}
+
+
app.current_room = null;
app.enter_room = function(room) {
if (app.current_room === room) return;
diff --git a/public/src/forum/accountedit.js b/public/src/forum/accountedit.js
index 9939f85b5c..6f37c755d4 100644
--- a/public/src/forum/accountedit.js
+++ b/public/src/forum/accountedit.js
@@ -129,7 +129,7 @@ $(document).ready(function() {
type: 'success',
title: 'Profile Updated',
message: 'Your profile has been updated successfully',
- timeout: 2000
+ timeout: 10000
});
}
);
diff --git a/src/posts.js b/src/posts.js
index f287928ae6..890cd924a5 100644
--- a/src/posts.js
+++ b/src/posts.js
@@ -187,7 +187,7 @@ marked.setOptions({
RDB.del('cid:' + cid + ':read_by_uid');
RDB.zadd('categories:recent_posts:cid:' + cid, Date.now(), pid);
-
+
topics.markAsRead(tid, uid);
});