Node.js based forum software built for the modern web
added loading spinner to topic.tpl
Baris Usaklicaaede7e847f
diff --git a/public/src/app.js b/public/src/app.jsindex a462e53b6f..2604f78608 100644--- a/public/src/app.js+++ b/public/src/app.js@@ -353,15 +353,22 @@ var socket,if(app.infiniteLoaderActive)return;app.infiniteLoaderActive = true;++ if($('#loading-indicator').attr('done') === '0')+ $('#loading-indicator').removeClass('hide');+socket.emit('api:topic.loadMore', {tid: tid,after: document.querySelectorAll('#post-container li[data-pid]').length}, function(data) {app.infiniteLoaderActive = false;if(data.posts.length) {+ $('#loading-indicator').attr('done', '0');app.createNewPosts(data);+ } else {+ $('#loading-indicator').attr('done', '1');}-+ $('#loading-indicator').addClass('hide');if(callback)callback(data.posts);});diff --git a/public/templates/topic.tpl b/public/templates/topic.tplindex 7a3aa20b8e..f7f829b6bb 100644--- a/public/templates/topic.tpl+++ b/public/templates/topic.tpl@@ -142,6 +142,9 @@</li><!-- END posts --></ul>+<div id="loading-indicator" style="text-align:center;" class="hide" done="0">+ <i class="icon-spinner icon-spin icon-large"></i>+</div><hr /><div class="topic-main-buttons"><button id="post_reply" class="btn btn-primary btn-lg post_reply" type="button">Reply</button>