mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-06 12:31:33 +01:00
fixes #17
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -129,7 +129,7 @@ $(document).ready(function() {
|
||||
type: 'success',
|
||||
title: 'Profile Updated',
|
||||
message: 'Your profile has been updated successfully',
|
||||
timeout: 2000
|
||||
timeout: 10000
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user