mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
[enh] Generalize call handlebars helper
This commit is contained in:
parent
1c6f5e4011
commit
fae6c974d1
3 changed files with 9 additions and 7 deletions
|
@ -663,7 +663,7 @@ input[type='radio'].nice-radio {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Permissions View **/
|
/** Groups View **/
|
||||||
#view-groups {
|
#view-groups {
|
||||||
.panel-heading a {
|
.panel-heading a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
|
@ -82,12 +82,6 @@
|
||||||
return data_groups.groups[group].members.indexOf(item) === -1;
|
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['all_users'].special = true;
|
||||||
data_groups.groups['visitors'].special = true;
|
data_groups.groups['visitors'].special = true;
|
||||||
data = {
|
data = {
|
||||||
|
|
|
@ -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) {
|
Handlebars.registerHelper('in', function(a) {
|
||||||
// skip first one
|
// skip first one
|
||||||
for (var i = 1; i < arguments.length; ++i) {
|
for (var i = 1; i < arguments.length; ++i) {
|
||||||
|
|
Loading…
Reference in a new issue