summaryrefslogtreecommitdiffstats
path: root/public/js
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2018-05-11 16:15:18 +0800
committerGitHub <noreply@github.com>2018-05-11 16:15:18 +0800
commitc14870c5ac52bf9d2d8b884222b4743accf9d929 (patch)
tree6a96283cd01130933743189a586786af31fa5cf2 /public/js
parentbc8400747a7f3fbeafdde1a137f32ef9ac25dff6 (diff)
downloadgitea-c14870c5ac52bf9d2d8b884222b4743accf9d929.tar.gz
gitea-c14870c5ac52bf9d2d8b884222b4743accf9d929.zip
fix blank topic (#3948)
Diffstat (limited to 'public/js')
-rw-r--r--public/js/index.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/public/js/index.js b/public/js/index.js
index 000229dbc1..e826c2f3f3 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -2197,7 +2197,11 @@ function initTopicbar() {
alert(res.message);
} else {
viewDiv.children(".topic").remove();
+ if (topics.length == 0) {
+ return
+ }
var topicArray = topics.split(",");
+
var last = viewDiv.children("a").last();
for (var i=0;i < topicArray.length; i++) {
$('<div class="ui green basic label topic" style="cursor:pointer;">'+topicArray[i]+'</div>').insertBefore(last)