]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5136 Fix handling of server errors when editing tags
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Fri, 13 Jun 2014 12:29:19 +0000 (14:29 +0200)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Fri, 13 Jun 2014 12:29:28 +0000 (14:29 +0200)
sonar-server/src/main/coffee/coding-rules/views/coding-rules-detail-view.coffee

index 54b69efdf97c96eb303acbb7c52249e9b0ccdb07..2f9ce297ca4884bfbc3a14e3521cbec77b85037e 100644 (file)
@@ -155,17 +155,22 @@ define [
 
 
     changeTags: ->
-      @ui.tagsEdit.show()
-      @ui.tagsList.hide()
+      if @ui.tagsEdit.show
+        @ui.tagsEdit.show()
+      if @ui.tagsList.hide
+        @ui.tagsList.hide()
       key.setScope 'tags'
       key 'escape', 'tags', => @cancelEdit()
 
 
     cancelEdit: ->
       key.unbind 'escape', 'tags'
-      @ui.tagsList.show()
-      @ui.tagInput.select2 'close'
-      @ui.tagsEdit.hide()
+      if @ui.tagsList.show
+        @ui.tagsList.show()
+      if @ui.tagInput.select2
+        @ui.tagInput.select2 'close'
+      if @ui.tagsEdit.hide
+        @ui.tagsEdit.hide()
 
 
     editDone: ->
@@ -179,7 +184,9 @@ define [
           tags: tags
       .done (r) =>
           @model.set 'tags', r.rule.tags
-          @render()
+          @cancelEdit()
+      .always =>
+        @render()
 
 
     showExtendDescriptionForm: ->