From 72d274c1f859ba5c10d8bfabb0017840a4ca7ced Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Wed, 17 Jul 2019 10:08:20 -0400 Subject: [PATCH] Add canSave to the form mixin to toggle whether or not the Next button is disabled --- js/mixins/form.js | 12 ++++++++++++ templates/task_orders/builder_base.html | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/js/mixins/form.js b/js/mixins/form.js index 01f2f24f..ddb33607 100644 --- a/js/mixins/form.js +++ b/js/mixins/form.js @@ -44,6 +44,18 @@ export default { }, }, + computed: { + canSave: function() { + if (!this.invalid) { + return true + } else if (this.changed && !this.invalid) { + return true + } else { + return false + } + }, + }, + data: function() { return { changed: this.hasChanges, diff --git a/templates/task_orders/builder_base.html b/templates/task_orders/builder_base.html index e99aef9b..14c3eaa4 100644 --- a/templates/task_orders/builder_base.html +++ b/templates/task_orders/builder_base.html @@ -13,7 +13,7 @@