From c24f9e7afbd08f2bf622e7a42c38c85b3ee0e80b Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Thu, 20 Nov 2014 11:55:45 +0100 Subject: [PATCH] Fix cancelling of editing of rule tags --- .../coding-rules/views/coding-rules-detail-view.coffee | 5 +++++ .../src/main/hbs/coding-rules/coding-rules-detail.hbs | 1 + server/sonar-web/src/main/less/coding-rules.less | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/server/sonar-web/src/main/coffee/coding-rules/views/coding-rules-detail-view.coffee b/server/sonar-web/src/main/coffee/coding-rules/views/coding-rules-detail-view.coffee index 7a10db2512f..d9697a317d3 100644 --- a/server/sonar-web/src/main/coffee/coding-rules/views/coding-rules-detail-view.coffee +++ b/server/sonar-web/src/main/coffee/coding-rules/views/coding-rules-detail-view.coffee @@ -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() diff --git a/server/sonar-web/src/main/hbs/coding-rules/coding-rules-detail.hbs b/server/sonar-web/src/main/hbs/coding-rules/coding-rules-detail.hbs index 24295ac0478..7da358161f2 100644 --- a/server/sonar-web/src/main/hbs/coding-rules/coding-rules-detail.hbs +++ b/server/sonar-web/src/main/hbs/coding-rules/coding-rules-detail.hbs @@ -31,6 +31,7 @@
+ {{t 'cancel'}} {{/if}} {{#if subcharacteristic}} diff --git a/server/sonar-web/src/main/less/coding-rules.less b/server/sonar-web/src/main/less/coding-rules.less index 23f96841f69..93a858dd9bc 100644 --- a/server/sonar-web/src/main/less/coding-rules.less +++ b/server/sonar-web/src/main/less/coding-rules.less @@ -210,6 +210,10 @@ line-height: 1; } +.coding-rules-details-tag-edit-cancel { + vertical-align: middle; +} + .coding-rules-detail-description { margin: 2 * @navigatorPadding 0; } -- 2.39.5