fix view-helper options

This commit is contained in:
yuri
2016-05-27 13:17:51 +03:00
parent b2a4ec238c
commit c2a7d90944
+4 -2
View File
@@ -230,7 +230,9 @@ Espo.define('view-helper', [], function () {
});
Handlebars.registerHelper('options', function (list, value, options) {
value = value || false;
if (typeof value === 'undefined') {
value = false;
}
list = list || {};
var html = '';
var isArray = (Object.prototype.toString.call(list) === '[object Array]');
@@ -238,7 +240,7 @@ Espo.define('view-helper', [], function () {
var multiple = (Object.prototype.toString.call(value) === '[object Array]');
var checkOption = function (name) {
if (multiple) {
return value.indexOf(name) != -1;
return value.indexOf(name) !== -1;
} else {
return value === name;
}