mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-04 04:04:20 +00:00 
			
		
		
		
	Load the comments once they are created.
This commit is contained in:
		@@ -13,12 +13,25 @@ ComunicWeb.components.comments.form = {
 | 
				
			|||||||
	 */
 | 
						 */
 | 
				
			||||||
	display: function(postID, target){
 | 
						display: function(postID, target){
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		//Create form contener
 | 
							//Check if we are creating a new comment of or reseting an existing one
 | 
				
			||||||
		var commentForm = createElem2({
 | 
							if(target.className != "comment-creation-form"){
 | 
				
			||||||
			appendTo: target,
 | 
					
 | 
				
			||||||
			type: "form",
 | 
								//Create form contener
 | 
				
			||||||
			class: "comment-creation-form"
 | 
								var commentForm = createElem2({
 | 
				
			||||||
		});
 | 
									appendTo: target,
 | 
				
			||||||
 | 
									type: "form",
 | 
				
			||||||
 | 
									class: "comment-creation-form"
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							else {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								//Reset current form
 | 
				
			||||||
 | 
								emptyElem(target);
 | 
				
			||||||
 | 
								var commentForm = target;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		//Create input group
 | 
							//Create input group
 | 
				
			||||||
		var inputGroup = createElem2({
 | 
							var inputGroup = createElem2({
 | 
				
			||||||
@@ -102,7 +115,15 @@ ComunicWeb.components.comments.form = {
 | 
				
			|||||||
					return;
 | 
										return;
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				//Perform next actions
 | 
									//Reset the creation form
 | 
				
			||||||
 | 
									ComunicWeb.components.comments.form.display(postID, commentForm);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									//Load the new comment before the form element
 | 
				
			||||||
 | 
									var newCommentTarget = createElem2({
 | 
				
			||||||
 | 
										insertBefore: commentForm,
 | 
				
			||||||
 | 
										type: "div"
 | 
				
			||||||
 | 
									});
 | 
				
			||||||
 | 
									ComunicWeb.components.comments.actions.reload(result.commentID, newCommentTarget);
 | 
				
			||||||
			});
 | 
								});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user