mirror of https://github.com/keeweb/keeweb.git
refactor: add hbs-helpers ifgtr, iflss
This commit is contained in:
parent
fab0b1ef79
commit
cd021b5299
|
@ -0,0 +1,9 @@
|
|||
import Handlebars from 'hbs';
|
||||
|
||||
Handlebars.registerHelper('ifgtr', function (lvalue, rvalue, options) {
|
||||
return lvalue > rvalue ? options.fn(this) : options.inverse(this);
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('ifgeq', function (lvalue, rvalue, options) {
|
||||
return lvalue >= rvalue ? options.fn(this) : options.inverse(this);
|
||||
});
|
|
@ -0,0 +1,9 @@
|
|||
import Handlebars from 'hbs';
|
||||
|
||||
Handlebars.registerHelper('iflss', function (lvalue, rvalue, options) {
|
||||
return lvalue < rvalue ? options.fn(this) : options.inverse(this);
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('ifleq', function (lvalue, rvalue, options) {
|
||||
return lvalue <= rvalue ? options.fn(this) : options.inverse(this);
|
||||
});
|
|
@ -2,5 +2,7 @@ import 'hbs-helpers/add';
|
|||
import 'hbs-helpers/cmp';
|
||||
import 'hbs-helpers/ifeq';
|
||||
import 'hbs-helpers/ifneq';
|
||||
import 'hbs-helpers/ifgtr';
|
||||
import 'hbs-helpers/iflss';
|
||||
import 'hbs-helpers/ifemptyoreq';
|
||||
import 'hbs-helpers/res';
|
||||
|
|
Loading…
Reference in New Issue