From 3da057f09143712653e298c35f158d9cc5cb3839 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Sun, 15 Jul 2018 12:30:47 +0530 Subject: [PATCH] Dropdown show/hide using Vue, styling --- ui/components/Dropdown.vue | 40 ++++++++++++++++++++++-------- ui/components/Form/FormActions.vue | 23 ++++++++++++++--- ui/styles/variables.scss | 3 ++- 3 files changed, 51 insertions(+), 15 deletions(-) diff --git a/ui/components/Dropdown.vue b/ui/components/Dropdown.vue index b3f3b3a9..b82b59c5 100644 --- a/ui/components/Dropdown.vue +++ b/ui/components/Dropdown.vue @@ -1,19 +1,22 @@ - diff --git a/ui/components/Form/FormActions.vue b/ui/components/Form/FormActions.vue index df6467c7..cb469f54 100644 --- a/ui/components/Form/FormActions.vue +++ b/ui/components/Form/FormActions.vue @@ -2,10 +2,10 @@
{{ title }}
- {{ _('Save') }} + {{ _('Save') }} {{ _('Submit') }} {{ _('Revert') }} - +
@@ -21,8 +21,11 @@ export default { data() { return { isDirty: false, + showSave: false, showSubmit: false, - showRevert: false + showRevert: false, + showNextAction: false, + disableSave: false } }, created() { @@ -45,6 +48,20 @@ export default { && !this.isDirty && !this.doc._notInserted && this.doc.submitted === 1; + + this.showNextAction = + !this.doc._notInserted + && this.links.length; + + this.showSave = + this.doc._notInserted ? + true : + this.meta.isSubmittable ? + (this.isDirty ? true : false) : + true; + + this.disableSave = + this.doc._notInserted ? false : !this.isDirty; } }, computed: { diff --git a/ui/styles/variables.scss b/ui/styles/variables.scss index 367009b9..1055578b 100644 --- a/ui/styles/variables.scss +++ b/ui/styles/variables.scss @@ -1,2 +1,3 @@ @import "~bootstrap/scss/functions"; -@import "~bootstrap/scss/variables"; \ No newline at end of file +@import "~bootstrap/scss/variables"; +@import "~bootstrap/scss/mixins"; \ No newline at end of file