diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-03-02 14:29:02 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-03-02 14:29:02 +0100 |
commit | e64a7dabc75d96f1b634d7e24ff49baddda82835 (patch) | |
tree | 2638cef5a88b3e4c1b88e1cb0bd9b8563bbf822a /server | |
parent | 086b9277eed074b5bbaa2f031d77466ffee50b1f (diff) | |
download | sonarqube-e64a7dabc75d96f1b634d7e24ff49baddda82835.tar.gz sonarqube-e64a7dabc75d96f1b634d7e24ff49baddda82835.zip |
fix bug with extra duplicated line in the popup
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-web/src/main/hbs/source-viewer/source-viewer-duplication-popup.hbs | 2 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/common/handlebars-extensions.js | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/server/sonar-web/src/main/hbs/source-viewer/source-viewer-duplication-popup.hbs b/server/sonar-web/src/main/hbs/source-viewer/source-viewer-duplication-popup.hbs index 2e83c813a0e..79947f601c6 100644 --- a/server/sonar-web/src/main/hbs/source-viewer/source-viewer-duplication-popup.hbs +++ b/server/sonar-web/src/main/hbs/source-viewer/source-viewer-duplication-popup.hbs @@ -28,7 +28,7 @@ Lines: {{#joinEach blocks ','}} <a class="link-action" data-key="{{../file.key}}" data-line="{{from}}"> - {{from}} – {{sum from size}} + {{from}} – {{sum from size -1}} </a> {{/joinEach}} </div> diff --git a/server/sonar-web/src/main/js/common/handlebars-extensions.js b/server/sonar-web/src/main/js/common/handlebars-extensions.js index 36f89fd0214..006a6abaa81 100644 --- a/server/sonar-web/src/main/js/common/handlebars-extensions.js +++ b/server/sonar-web/src/main/js/common/handlebars-extensions.js @@ -259,7 +259,10 @@ }); Handlebars.registerHelper('sum', function(a, b) { - return a + b; + var args = Array.prototype.slice.call(arguments, 0, -1); + return args.reduce(function (p, c) { + return p + +c; + }, 0); }); Handlebars.registerHelper('dashboardUrl', function(componentKey, componentQualifier) { |