diff --git a/frontend/src/views/Observation.vue b/frontend/src/views/Observation.vue index 08ba892..8be5b8a 100644 --- a/frontend/src/views/Observation.vue +++ b/frontend/src/views/Observation.vue @@ -1,5 +1,15 @@ @@ -96,7 +112,8 @@ export default { improvements: null } ], - totals: [0, 0, 0, 0, 0] + totals: [0, 0, 0, 0, 0], + submitPassword: null }; }, computed: { @@ -172,6 +189,20 @@ export default { onSubmit: function(e) { e.preventDefault(); e.stopPropagation(); + var form = document.getElementById("submission-form"); + if (form.checkValidity()) { + this.showModal(); + } + form.classList.add("was-validated"); + }, + showModal() { + this.$refs.submissionModal.show(); + }, + hideModal() { + this.$refs.submissionModal.hide(); + this.submitPassword = null; + }, + reallySubmit() { var form = document.getElementById("submission-form"); if (form.checkValidity()) { Vue.axios @@ -194,7 +225,6 @@ export default { console.log(error); }); } - form.classList.add("was-validated"); } } };