]> source.dussan.org Git - sonarqube.git/commitdiff
fix bug with extra duplicated line in the popup
authorStas Vilchik <vilchiks@gmail.com>
Mon, 2 Mar 2015 13:29:02 +0000 (14:29 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 2 Mar 2015 13:29:02 +0000 (14:29 +0100)
server/sonar-web/src/main/hbs/source-viewer/source-viewer-duplication-popup.hbs
server/sonar-web/src/main/js/common/handlebars-extensions.js

index 2e83c813a0ed4dad413c21c5279f730f5178ed49..79947f601c6ee135bc9d72b4e0974bb52122ef66 100644 (file)
@@ -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>
index 36f89fd0214ac473fc647879c85268df596c8459..006a6abaa81a3aa663de02c1f1b7ee6515049c3e 100644 (file)
   });
 
   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) {