summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2019-02-05 21:40:56 +0100
committerLauris BH <lauris@nix.lv>2019-02-05 22:40:56 +0200
commit2ec9bf9048b86092c3c31a150df75eae753df7c1 (patch)
tree563daa2f89a2994d66e3fd5fe1d0f6b48b93aa30 /public
parent17728935052cd564bc7d603a3f7379d228b9b4cd (diff)
downloadgitea-2ec9bf9048b86092c3c31a150df75eae753df7c1.tar.gz
gitea-2ec9bf9048b86092c3c31a150df75eae753df7c1.zip
UI: Fixes for repo topic editor (#5971)
- Properly hides the edit interface when saving a empty topic list - Align the Done button with the edit box
Diffstat (limited to 'public')
-rw-r--r--public/js/index.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/public/js/index.js b/public/js/index.js
index c69cb753d4..810d835340 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -2635,16 +2635,15 @@ function initTopicbar() {
}, function(data, textStatus, xhr){
if (xhr.responseJSON.status === 'ok') {
viewDiv.children(".topic").remove();
- if (topics.length === 0) {
- return
- }
- var topicArray = topics.split(",");
+ if (topics.length) {
+ 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)
+ 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)
+ }
}
- editDiv.css('display', 'none'); // hide Semantic UI Grid
+ editDiv.css('display', 'none');
viewDiv.show();
}
}).fail(function(xhr){