mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +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 | ||||
| 				}); | ||||
| 			} | ||||
| 		); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user