diff --git a/ayanova/src/views/home-notify-direct.vue b/ayanova/src/views/home-notify-direct.vue
index 2f34fff9..aa1825ee 100644
--- a/ayanova/src/views/home-notify-direct.vue
+++ b/ayanova/src/views/home-notify-direct.vue
@@ -13,6 +13,7 @@
v-model="userId"
:label="$ay.t('UserList')"
ref="userPickList"
+ @input="checkSave()"
>
@@ -20,18 +21,6 @@
-
@@ -55,6 +44,7 @@
ref="message"
auto-grow
:clearable="!formState.readOnly"
+ @input="checkSave()"
>
@@ -155,6 +145,18 @@ export default {
}
},
methods: {
+ checkSave() {
+ let hasSelection =
+ this.toUsers.length > 0 || (this.userId != null && this.userId != 0);
+ let hasText = this.message != null && this.message != "";
+
+ this.formState.dirty = hasSelection && hasText;
+ if (this.canSave) {
+ window.$gz.eventBus.$emit("menu-enable-item", FORM_KEY + ":save");
+ } else {
+ window.$gz.eventBus.$emit("menu-disable-item", FORM_KEY + ":save");
+ }
+ },
closeChip(item) {
// console.log(item);
// debugger;
@@ -162,22 +164,21 @@ export default {
if (i != -1) {
this.toUsers.splice(i, 1);
}
+ this.checkSave();
},
addSelected() {
let selected = this.$refs.userPickList.getFullSelectionValue();
if (selected == null) {
- console.log("Selected is null");
return;
}
//already in the list?
if (this.toUsers.find(z => z.id == selected.id)) {
- console.log(`User ${selected.name} is already in the list`);
return;
}
- console.log(`Pushing user ${selected.name} into list`);
this.toUsers.push(selected);
this.userId = 0;
+ this.checkSave();
},
ayaTypes: function() {
return window.$gz.type;
@@ -186,11 +187,7 @@ export default {
form() {
return window.$gz.form;
},
- fieldValueChanged(ref) {
- if (!this.formState.loading && !this.formState.readOnly) {
- window.$gz.form.fieldValueChanged(this, ref);
- }
- },
+
async submit() {
let vm = this;
if (vm.canSave) {