From: Stas Vilchik Date: Mon, 2 Mar 2015 13:29:02 +0000 (+0100) Subject: fix bug with extra duplicated line in the popup X-Git-Tag: 5.1-RC1~41 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e64a7dabc75d96f1b634d7e24ff49baddda82835;p=sonarqube.git fix bug with extra duplicated line in the popup --- 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 ','}} - {{from}} – {{sum from size}} + {{from}} – {{sum from size -1}} {{/joinEach}} 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) {