Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getData bugfix and onDependencyChanged feature #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/js/brutusin-json-forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ if (typeof brutusin === "undefined") {
if (s === null) {
s = SCHEMA_ANY;
}
if (s.$ref) {
if (s && s.$ref) {
s = getDefinition(s.$ref);
}
if (object instanceof Array) {
Expand All @@ -856,15 +856,15 @@ if (typeof brutusin === "undefined") {
continue;
}
var ss = null;
if (s.hasOwnProperty("properties") && s.properties.hasOwnProperty(prop)) {
if (s && s.hasOwnProperty("properties") && s.properties.hasOwnProperty(prop)) {
ss = s.properties[prop];
}
if (ss === null && s.hasOwnProperty("additionalProperties")) {
if (ss === null && s && s.hasOwnProperty("additionalProperties")) {
if (typeof s.additionalProperties === 'object') {
ss = s.additionalProperties;
}
}
if (ss === null && s.hasOwnProperty("patternProperties")) {
if (ss === null && s && s.hasOwnProperty("patternProperties")) {
for (var p in s.patternProperties) {
var r = RegExp(p);
if (prop.search(r) !== -1) {
Expand All @@ -879,7 +879,7 @@ if (typeof brutusin === "undefined") {
nonEmpty = true;
}
}
if (nonEmpty || s.required) {
if (nonEmpty || s && s.required) {
return clone;
} else {
return null;
Expand Down Expand Up @@ -1346,7 +1346,7 @@ if (typeof brutusin === "undefined") {
BrutusinForms.onResolutionFinished(source);
};
BrutusinForms.onResolutionStarted(source);
obj.schemaResolver(arr, obj.getData(), cb);
obj.schemaResolver(arr, obj.getData(), cb, source);


}
Expand Down