From fae6c974d18fbe84fd02ccb51d13f800f74b123e Mon Sep 17 00:00:00 2001 From: ljf Date: Sun, 20 Oct 2019 01:47:24 +0200 Subject: [PATCH] [enh] Generalize call handlebars helper --- src/css/style.less | 2 +- src/js/yunohost/controllers/users.js | 6 ------ src/js/yunohost/main.js | 8 ++++++++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/css/style.less b/src/css/style.less index 1f5ea582..cfdc2f6f 100644 --- a/src/css/style.less +++ b/src/css/style.less @@ -663,7 +663,7 @@ input[type='radio'].nice-radio { } -/** Permissions View **/ +/** Groups View **/ #view-groups { .panel-heading a { text-decoration: none; diff --git a/src/js/yunohost/controllers/users.js b/src/js/yunohost/controllers/users.js index dd5e4db4..479657d7 100644 --- a/src/js/yunohost/controllers/users.js +++ b/src/js/yunohost/controllers/users.js @@ -82,12 +82,6 @@ return data_groups.groups[group].members.indexOf(item) === -1; }); } - Handlebars.registerHelper('call', function () { - var args = Array.prototype.slice.call(arguments); - var func = args.shift(); - args.pop(); - return func.apply(null, args); - }); data_groups.groups['all_users'].special = true; data_groups.groups['visitors'].special = true; data = { diff --git a/src/js/yunohost/main.js b/src/js/yunohost/main.js index faa196e9..4d6ef4e4 100644 --- a/src/js/yunohost/main.js +++ b/src/js/yunohost/main.js @@ -132,6 +132,14 @@ } }); + // Be able to call a function given in context + Handlebars.registerHelper('call', function () { + var args = Array.prototype.slice.call(arguments); + var func = args.shift(); + args.pop(); + return func.apply(null, args); + }); + Handlebars.registerHelper('in', function(a) { // skip first one for (var i = 1; i < arguments.length; ++i) {