mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
fixes #17
This commit is contained in:
@@ -107,10 +107,23 @@ var socket,
|
|||||||
|
|
||||||
var alert = $('#'+alert_id);
|
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) {
|
if(alert.length > 0) {
|
||||||
alert.find('strong').html(params.title);
|
alert.find('strong').html(params.title);
|
||||||
alert.find('p').html(params.message);
|
alert.find('p').html(params.message);
|
||||||
alert.attr('class', "alert toaster-alert " + ((params.type=='warning') ? '' : "alert-" + params.type));
|
alert.attr('class', "alert toaster-alert " + ((params.type=='warning') ? '' : "alert-" + params.type));
|
||||||
|
|
||||||
|
clearTimeout(alert.attr('timeoutId'));
|
||||||
|
startTimeout(alert, params.timeout);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var div = document.createElement('div'),
|
var div = document.createElement('div'),
|
||||||
@@ -140,11 +153,7 @@ var socket,
|
|||||||
jQuery('#'+params.location).prepend(jQuery(div).fadeIn('100'));
|
jQuery('#'+params.location).prepend(jQuery(div).fadeIn('100'));
|
||||||
|
|
||||||
if (params.timeout) {
|
if (params.timeout) {
|
||||||
setTimeout(function() {
|
startTimeout(div, params.timeout);
|
||||||
jQuery(div).fadeOut(1000, function() {
|
|
||||||
this.remove();
|
|
||||||
});
|
|
||||||
}, params.timeout)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.clickfn) {
|
if (params.clickfn) {
|
||||||
@@ -158,6 +167,8 @@ var socket,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
app.current_room = null;
|
app.current_room = null;
|
||||||
app.enter_room = function(room) {
|
app.enter_room = function(room) {
|
||||||
if (app.current_room === room) return;
|
if (app.current_room === room) return;
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ $(document).ready(function() {
|
|||||||
type: 'success',
|
type: 'success',
|
||||||
title: 'Profile Updated',
|
title: 'Profile Updated',
|
||||||
message: 'Your profile has been updated successfully',
|
message: 'Your profile has been updated successfully',
|
||||||
timeout: 2000
|
timeout: 10000
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user