diff options
author | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-07-18 15:29:01 +0200 |
---|---|---|
committer | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-07-23 17:57:06 +0200 |
commit | 24e6245875263c867c3f34733a3cefdefc279597 (patch) | |
tree | 927d1c3d8e12aa1d4b68e08e47605804a1e5dea9 /server/sonar-web/src/main/coffee/coding-rules | |
parent | c9bb2e781dd5efa1706ff9166af167a9519fabe9 (diff) | |
download | sonarqube-24e6245875263c867c3f34733a3cefdefc279597.tar.gz sonarqube-24e6245875263c867c3f34733a3cefdefc279597.zip |
SONAR-5368 Back to bubble popup for debt remed. function
Diffstat (limited to 'server/sonar-web/src/main/coffee/coding-rules')
-rw-r--r-- | server/sonar-web/src/main/coffee/coding-rules/views/coding-rules-debt-popup-view.coffee | 16 | ||||
-rw-r--r-- | server/sonar-web/src/main/coffee/coding-rules/views/coding-rules-detail-view.coffee | 21 |
2 files changed, 30 insertions, 7 deletions
diff --git a/server/sonar-web/src/main/coffee/coding-rules/views/coding-rules-debt-popup-view.coffee b/server/sonar-web/src/main/coffee/coding-rules/views/coding-rules-debt-popup-view.coffee new file mode 100644 index 00000000000..c8882d87fb4 --- /dev/null +++ b/server/sonar-web/src/main/coffee/coding-rules/views/coding-rules-debt-popup-view.coffee @@ -0,0 +1,16 @@ +define [ + 'backbone.marionette' + 'templates/coding-rules' + 'common/popup' +], ( + Marionette + Templates + Popup +) -> + + class CodingRulesDebtPopupView extends Popup + template: Templates['coding-rules-debt-popup'] + + serializeData: -> + _.extend super, + subcharacteristic: @options.app.getSubcharacteristicName(@model.get 'debtSubChar') 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 cb31e14f672..dd9bdd55412 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 @@ -6,6 +6,7 @@ define [ 'coding-rules/views/coding-rules-detail-custom-rules-view' 'coding-rules/views/coding-rules-detail-custom-rule-view' 'coding-rules/views/coding-rules-parameter-popup-view' + 'coding-rules/views/coding-rules-debt-popup-view' 'templates/coding-rules' ], ( Backbone @@ -15,6 +16,7 @@ define [ CodingRulesDetailCustomRulesView CodingRulesDetailCustomRuleView CodingRulesParameterPopupView + CodingRulesDebtPopupView Templates ) -> @@ -37,7 +39,6 @@ define [ tagsList: '.coding-rules-detail-tag-list' subcharacteristic: '.coding-rules-subcharacteristic' - subcharacteristicMore: '.coding-rules-subcharacteristic-more' descriptionExtra: '#coding-rules-detail-description-extra' extendDescriptionLink: '#coding-rules-detail-extend-description' @@ -74,8 +75,8 @@ define [ 'click @ui.changeManualRule': 'changeManualRule' 'click @ui.deleteCustomRule': 'deleteRule' - 'click .coding-rules-subcharacteristic': 'toggleDebtInfo' 'click .coding-rules-detail-parameter-name': 'toggleParameterDescription' + 'click .coding-rules-subcharacteristic': 'showDebtPopup' initialize: (options) -> super options @@ -173,15 +174,21 @@ define [ @ui.extendDescriptionSpinner.hide() - toggleDebtInfo: (e) -> - @ui.subcharacteristicMore.toggle() - false - - toggleParameterDescription: (e) -> jQuery(e.currentTarget).next('.coding-rules-detail-parameter-description').toggle(); + showDebtPopup: (e) -> + e.stopPropagation() + jQuery('body').click() + popup = new CodingRulesDebtPopupView + model: @model + app: @options.app + triggerEl: jQuery(e.currentTarget) + popup.render() + false + + hideContext: -> @contextRegion.reset() @$(@contextRegion.el).hide() |