Skip to content
Snippets Groups Projects
Commit 60d32504 authored by Sandro Lutz's avatar Sandro Lutz
Browse files

Minor changes according to discussion in !30

parent b0487a0f
No related branches found
No related tags found
1 merge request!30Studydocs autocomplete
......@@ -13,7 +13,7 @@ export default class InputGroup {
view(vnode) {
// set display-settings accoridng to error-state
let errorField = null;
let groupClasses = vnode.attrs.classes ? vnode.attrs.classes : '';
let groupClasses = vnode.attrs.classes || '';
const errors = this.getErrors();
if (errors.length > 0) {
errorField = m('span', `Error: ${errors.join(', ')}`);
......@@ -37,15 +37,13 @@ export default class InputGroup {
]);
}
args.list = `${vnode.attrs.name}-datalist`;
if (typeof args.getSuggestions === 'function') {
if (args.getSuggestions) {
args.oninput_original = args.oninput;
args.oninput = (e) => {
if (typeof args.getSuggestions === 'function') {
args.getSuggestions(e.target.value, (result) => {
this.suggestions = result;
});
}
if (typeof args.oninput_original === 'function') {
args.getSuggestions(e.target.value, (result) => {
this.suggestions = result;
});
if (args.oninput_original) {
args.oninput_original(e);
}
};
......
import m from 'mithril';
import Ajv from 'ajv';
import jsonSchemaDraft04 from 'ajv/lib/refs/json-schema-draft-04.json';
import { isNullOrUndefined } from 'util';
import { log } from '../../models/log';
import inputGroup from './inputGroup';
import selectGroup from './selectGroup';
......@@ -27,7 +26,7 @@ export default class JSONSchemaForm {
} else {
this.ajv.addSchema(this.schema, 'schema');
}
if (isNullOrUndefined(this.fieldOrder)) {
if (!this.fieldOrder) {
this.fieldOrder = [];
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment