aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/helpers/handlebars/eachChanged.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/helpers/handlebars/eachChanged.js')
-rw-r--r--server/sonar-web/src/main/js/helpers/handlebars/eachChanged.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/helpers/handlebars/eachChanged.js b/server/sonar-web/src/main/js/helpers/handlebars/eachChanged.js
new file mode 100644
index 00000000000..e64695a5aaa
--- /dev/null
+++ b/server/sonar-web/src/main/js/helpers/handlebars/eachChanged.js
@@ -0,0 +1,9 @@
+module.exports = function (context, property, options) {
+ var ret = '';
+ context.forEach(function (d, i) {
+ var changed = i > 0 ? d[property] !== context[i - 1][property] : true,
+ c = _.extend({ changed: changed }, d);
+ ret += options.fn(c);
+ });
+ return ret;
+};