mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 19:15:58 +01:00 
			
		
		
		
	move removeExtra to IS
This commit is contained in:
		| @@ -152,7 +152,7 @@ define('forum/topic/posts', [ | ||||
| 				components.get('topic').append(html); | ||||
| 			} | ||||
|  | ||||
| 			removeExtraPosts(direction); | ||||
| 			infinitescroll.removeExtra(components.get('posts'), direction, 40); | ||||
|  | ||||
| 			html.hide().fadeIn('slow'); | ||||
|  | ||||
| @@ -167,23 +167,6 @@ define('forum/topic/posts', [ | ||||
| 		}); | ||||
| 	} | ||||
|  | ||||
| 	function removeExtraPosts(direction) { | ||||
| 		var posts = components.get('post'); | ||||
| 		if (posts.length > 40) { | ||||
| 			var removeCount = posts.length - 40; | ||||
| 			if (direction > 0) { | ||||
| 				var height = $(document).height(), | ||||
| 					scrollTop = $(window).scrollTop(); | ||||
|  | ||||
| 				posts.slice(0, removeCount).remove(); | ||||
|  | ||||
| 				$(window).scrollTop(scrollTop + ($(document).height() - height)); | ||||
| 			} else { | ||||
| 				posts.slice(posts.length - removeCount).remove(); | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	function onNewPostsLoaded(html, pids) { | ||||
| 		if (app.user.uid) { | ||||
| 			socket.emit('posts.getPrivileges', pids, function(err, privileges) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user