diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2014-12-16 13:25:55 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2014-12-16 13:26:03 +0100 |
commit | 4a0c9af2889ff6192609e95bd3902734520643d5 (patch) | |
tree | 4baa917c831a4797702dfd8fa1a407ff75fc0010 /server/sonar-web/src/main/js/common | |
parent | 1cad1d823b3a55c56b850476af6e0721852b6961 (diff) | |
download | sonarqube-4a0c9af2889ff6192609e95bd3902734520643d5.tar.gz sonarqube-4a0c9af2889ff6192609e95bd3902734520643d5.zip |
SONAR-5884 Finish measures window
Diffstat (limited to 'server/sonar-web/src/main/js/common')
-rw-r--r-- | server/sonar-web/src/main/js/common/handlebars-extensions.js | 20 |
1 files changed, 20 insertions, 0 deletions
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 2d0bd715144..f5e8e3cfe0b 100644 --- a/server/sonar-web/src/main/js/common/handlebars-extensions.js +++ b/server/sonar-web/src/main/js/common/handlebars-extensions.js @@ -132,6 +132,26 @@ define(['handlebars'], function (Handlebars) { return ret; }); + Handlebars.registerHelper('eachEven', function (context, options) { + var ret = ''; + context.forEach(function (d, i) { + if (i % 2 === 0) { + ret += options.fn(d); + } + }); + return ret; + }); + + Handlebars.registerHelper('eachOdd', function (context, options) { + var ret = ''; + context.forEach(function (d, i) { + if (i % 2 === 1) { + ret += options.fn(d); + } + }); + return ret; + }); + Handlebars.registerHelper('eq', function(v1, v2, options) { // use `==` instead of `===` to ignore types return v1 == v2 ? options.fn(this) : options.inverse(this); |