From d1c73f7602df30f8c838e4bbbc2529883ebde1bd Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Thu, 8 Jan 2015 11:13:03 +0100 Subject: [PATCH] Replace overlay component with modals --- .../src/main/coffee/common/overlay.coffee | 28 ------ .../src/main/coffee/issue/issue-view.coffee | 1 + .../coffee/issue/views/rule-overlay.coffee | 6 +- .../src/main/hbs/issue/issue-rule.hbs | 38 ++++---- .../source-viewer/source-viewer-measures.hbs | 96 ++++++++++--------- server/sonar-web/src/main/js/common/modals.js | 3 + .../src/main/js/source-viewer/header.js | 6 +- .../main/js/source-viewer/measures-overlay.js | 43 ++++----- .../src/main/less/components/modals.less | 13 +++ .../src/main/less/components/source.less | 9 +- 10 files changed, 121 insertions(+), 122 deletions(-) delete mode 100644 server/sonar-web/src/main/coffee/common/overlay.coffee diff --git a/server/sonar-web/src/main/coffee/common/overlay.coffee b/server/sonar-web/src/main/coffee/common/overlay.coffee deleted file mode 100644 index 70574bef9ae..00000000000 --- a/server/sonar-web/src/main/coffee/common/overlay.coffee +++ /dev/null @@ -1,28 +0,0 @@ -define [ - 'backbone.marionette' -], ( - Marionette -) -> - - $ = jQuery - - - class extends Marionette.ItemView - className: 'overlay-popup' - - - events: -> - 'click .overlay-popup-close': 'close' - - - onRender: -> - @$el.isolatedScroll() - @$el.detach().appendTo $('body') - key 'escape', 'overlay-popup', => @close() - @keyScope = key.getScope() - key.setScope 'overlay-popup' - - - onClose: -> - key.unbind 'overlay-popup' - key.setScope @keyScope diff --git a/server/sonar-web/src/main/coffee/issue/issue-view.coffee b/server/sonar-web/src/main/coffee/issue/issue-view.coffee index eff00d06d1e..b56ea55e2fa 100644 --- a/server/sonar-web/src/main/coffee/issue/issue-view.coffee +++ b/server/sonar-web/src/main/coffee/issue/issue-view.coffee @@ -265,6 +265,7 @@ define [ $.get "#{baseUrl}/api/rules/show", key: ruleKey, (r) => ruleOverlay = new RuleOverlay model: new Backbone.Model r.rule + large: true ruleOverlay.render() diff --git a/server/sonar-web/src/main/coffee/issue/views/rule-overlay.coffee b/server/sonar-web/src/main/coffee/issue/views/rule-overlay.coffee index 54d13bd8f0a..8f87f1eecbf 100644 --- a/server/sonar-web/src/main/coffee/issue/views/rule-overlay.coffee +++ b/server/sonar-web/src/main/coffee/issue/views/rule-overlay.coffee @@ -1,12 +1,12 @@ define [ - 'common/overlay' + 'common/modals' 'templates/issue' ], ( - Overlay + ModalView Templates ) -> - class extends Overlay + class extends ModalView template: Templates['issue-rule'] diff --git a/server/sonar-web/src/main/hbs/issue/issue-rule.hbs b/server/sonar-web/src/main/hbs/issue/issue-rule.hbs index cee912e9594..deb4a080cf3 100644 --- a/server/sonar-web/src/main/hbs/issue/issue-rule.hbs +++ b/server/sonar-web/src/main/hbs/issue/issue-rule.hbs @@ -1,25 +1,27 @@ -

- {{name}} - - {{t 'coding_rules.permalink'}} - -

+ diff --git a/server/sonar-web/src/main/hbs/source-viewer/source-viewer-measures.hbs b/server/sonar-web/src/main/hbs/source-viewer/source-viewer-measures.hbs index 166e9c6beea..02278679b89 100644 --- a/server/sonar-web/src/main/hbs/source-viewer/source-viewer-measures.hbs +++ b/server/sonar-web/src/main/hbs/source-viewer/source-viewer-measures.hbs @@ -1,60 +1,62 @@ -
- {{#unless removed}} - {{#if projectName}} -
- {{qualifierIcon 'TRK'}} {{projectName}} - {{#if subProjectName}} -     - {{qualifierIcon 'TRK'}} {{subProjectName}} - {{/if}} -
- {{/if}} - -
- {{qualifierIcon q}} {{default path longName}} -
- {{else}} -
{{removedMessage}}
- {{/unless}} -
+