Browse Source

Hide load more if no more to load

Nathaniel van Diepen 10 years ago
parent
commit
4456f5182c
1 changed files with 6 additions and 0 deletions
  1. 6 0
      js/index.js

+ 6 - 0
js/index.js

@@ -356,6 +356,9 @@
 						t.data('at',t.prev().children().length);
 						t.text('Load More');
 					}
+					if(t.prev().children().length < 10){
+						t.hide();
+					}
 				}).click(function(){
 					var t = $(this),
 						data = {
@@ -373,6 +376,9 @@
 					apiCall(data,function(d){
 						var tmplt = Handlebars.compile(template('pages','comment')),
 							i;
+						if(d.messages.length < 10){
+							t.hide();
+						}
 						for(i in d.messages){
 							try{
 								t.prev().append(