Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions resources/js/components/FormField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,18 @@
}
},

created() {
Nova.$on('nova-dependency-container-' + this.field.attribute, this.dependencyChange)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this accomplish?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it used for another components to call this component field

},

methods: {

registerDependencyWatchers(root) {
root.$children.forEach(component => {
if (this.componentIsDependency(component)) {

component.$watch('value', (value) => {
this.dependencyValues[component.field.attribute] = (typeof value === 'object' ? value.value : value);
this.dependencyValues[component.field.attribute] = (typeof value === 'object' ? value.value : value);
this.updateDependencyStatus()
}, {immediate: true})

Expand Down Expand Up @@ -72,7 +77,7 @@
return;
}

if(dependency.hasOwnProperty('value') && this.dependencyValues[dependency.field] !== dependency.value) {
if(dependency.hasOwnProperty('value') && this.dependencyValues[dependency.field] != dependency.value) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I would say this change would be good, since first you as a dev should know what the value is that you are checking against, but also there are some odd type behaviors in JS that I don't think we want to mess with.
Is there a specific reason to convert this from !== to a !=?

this.dependenciesSatisfied = false;
return;
}
Expand Down