aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/common/handlebars-extensions.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/common/handlebars-extensions.js')
-rw-r--r--server/sonar-web/src/main/js/common/handlebars-extensions.js5
1 files changed, 5 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 5f19ef85298..2c851270ee9 100644
--- a/server/sonar-web/src/main/js/common/handlebars-extensions.js
+++ b/server/sonar-web/src/main/js/common/handlebars-extensions.js
@@ -147,6 +147,11 @@ define(['handlebars'], function (Handlebars) {
return cond ? options.fn(this) : options.inverse(this);
});
+ Handlebars.registerHelper('empty', function(array, options) {
+ var cond = _.isArray(array) && array.length > 0;
+ return cond ? options.inverse(this) : options.fn(this);
+ });
+
Handlebars.registerHelper('all', function() {
var args = Array.prototype.slice.call(arguments, 0, -1),
options = arguments[arguments.length - 1],