diff options
Diffstat (limited to 'pyload/web/app/scripts/helpers/ifEq.js')
-rw-r--r-- | pyload/web/app/scripts/helpers/ifEq.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pyload/web/app/scripts/helpers/ifEq.js b/pyload/web/app/scripts/helpers/ifEq.js new file mode 100644 index 000000000..1c8a71b61 --- /dev/null +++ b/pyload/web/app/scripts/helpers/ifEq.js @@ -0,0 +1,14 @@ +define('helpers/ifEq', ['underscore', 'handlebars'], + function(_, Handlebars) { + /*jshint validthis:true */ + 'use strict'; + function ifEq(v1, v2, options) { + if (v1 === v2) { + return options.fn(this); + } + return options.inverse(this); + } + + Handlebars.registerHelper('ifEq', ifEq); + return ifEq; + }); |