This commit is contained in:
@@ -263,21 +263,27 @@ export default {
|
||||
}
|
||||
};
|
||||
},
|
||||
// ,
|
||||
// watch: {
|
||||
// canSave: {
|
||||
// // xeslint-disable-next-line
|
||||
// handler: function(newState) {
|
||||
// this.$gzevent.$emit(
|
||||
// "menu-replace-item",
|
||||
// "inventory-widget-edit:save",
|
||||
// newState
|
||||
// );
|
||||
// //todo: change the save button state here
|
||||
// //console.log("Valid CHANGED, was " + oldObj + " Now is " + newObj);
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
//WATCHERS
|
||||
watch: {
|
||||
formState: {
|
||||
// eslint-disable-next-line
|
||||
handler: function(val, oldVal) {
|
||||
if (this.formState.loading) {
|
||||
return;
|
||||
}
|
||||
var canSave = val.dirty && val.valid;
|
||||
if (canSave) {
|
||||
this.$gzevent.$emit("menu-enable-item", "inventory-widget-edit:save");
|
||||
} else {
|
||||
this.$gzevent.$emit(
|
||||
"menu-disable-item",
|
||||
"inventory-widget-edit:save"
|
||||
);
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
canSave: function() {
|
||||
return this.formState.valid && this.formState.dirty;
|
||||
|
||||
Reference in New Issue
Block a user