]> source.dussan.org Git - sonarqube.git/commitdiff
Fix cancelling of editing of rule tags
authorStas Vilchik <vilchiks@gmail.com>
Thu, 20 Nov 2014 10:55:45 +0000 (11:55 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Thu, 20 Nov 2014 10:55:45 +0000 (11:55 +0100)
server/sonar-web/src/main/coffee/coding-rules/views/coding-rules-detail-view.coffee
server/sonar-web/src/main/hbs/coding-rules/coding-rules-detail.hbs
server/sonar-web/src/main/less/coding-rules.less

index 7a10db2512ffe51c5ea239bf9ead1de7f94df820..d9697a317d307ade45d1118fcda0259780d23841 100644 (file)
@@ -36,6 +36,7 @@ define [
       tagInput: '.coding-rules-detail-tag-input'
       tagsEdit: '.coding-rules-detail-tag-edit'
       tagsEditDone: '.coding-rules-detail-tag-edit-done'
+      tagsEditCancel: '.coding-rules-details-tag-edit-cancel'
       tagsList: '.coding-rules-detail-tag-list'
 
       subcharacteristic: '.coding-rules-subcharacteristic'
@@ -61,6 +62,7 @@ define [
     events:
       'click @ui.tagsChange': 'changeTags'
       'click @ui.tagsEditDone': 'editDone'
+      'click @ui.tagsEditCancel': 'cancelEdit'
 
       'click @ui.extendDescriptionLink': 'showExtendDescriptionForm'
       'click @ui.cancelExtendDescription': 'hideExtendDescriptionForm'
@@ -199,6 +201,7 @@ define [
         @ui.tagsEdit.show()
       if @ui.tagsList.hide
         @ui.tagsList.hide()
+      @tagsBuffer = @ui.tagInput.select2 'val'
       key.setScope 'tags'
       key 'escape', 'tags', => @cancelEdit()
 
@@ -208,6 +211,8 @@ define [
       if @ui.tagsList.show
         @ui.tagsList.show()
       if @ui.tagInput.select2
+        console.log @tagsBuffer
+        @ui.tagInput.select2 'val', @tagsBuffer
         @ui.tagInput.select2 'close'
       if @ui.tagsEdit.hide
         @ui.tagsEdit.hide()
index 24295ac0478e6f1797edaa00a22dae4e2c282d92..7da358161f254c6cc33c57f9090a776fcde5a158 100644 (file)
@@ -31,6 +31,7 @@
     <div class="button-group">
       <button class="coding-rules-detail-tag-edit-done">{{t 'Done'}}</button>
     </div>
+    <a class="coding-rules-details-tag-edit-cancel">{{t 'cancel'}}</a>
   </li>{{/if}}
 
   {{#if subcharacteristic}}
index 23f96841f69fbc4cddd4846c714b9705df23ebb9..93a858dd9bc5dec9d186d4327093dc182765a2c7 100644 (file)
   line-height: 1;
 }
 
+.coding-rules-details-tag-edit-cancel {
+  vertical-align: middle;
+}
+
 .coding-rules-detail-description {
   margin: 2 * @navigatorPadding 0;
 }