Fix boolean and index pattern editors in advanced settings.

This commit is contained in:
lukasolson 2015-03-31 16:07:20 -07:00
parent 57d2bb4438
commit 47142af7a0
3 changed files with 6 additions and 2 deletions

View file

@ -47,7 +47,7 @@ define(function (require) {
var editor = getEditorType(conf);
conf.json = editor === 'json';
conf.bool = editor === 'bool';
conf.bool = editor === 'boolean';
conf.array = editor === 'array';
conf.normal = editor === 'normal';
conf.tooComplex = !editor;

View file

@ -15,7 +15,7 @@ define(function (require) {
return 'array';
}
return (typeof def.value);
return (def.value != null ? typeof def.value : typeof value);
}
return getValType;

View file

@ -26,6 +26,10 @@ define(function (require) {
expect(getValType({value: 'someString'})).to.be('string');
expect(getValType({value: 'someString'}, 42)).to.be('string');
});
it('should return the type of the value if the default value is null', function () {
expect(getValType({value: null}, 'someString')).to.be('string');
});
});
});
});