diff --git a/src/App.scss b/src/App.scss index 2afc43908..dc784fdd0 100644 --- a/src/App.scss +++ b/src/App.scss @@ -390,6 +390,20 @@ nav { } } +.menu-item { + line-height: var(--__line-height); + font-family: inherit; + font-weight: 400; + font-size: 100%; + cursor: pointer; + + a, + button:not(.button-default) { + color: var(--text); + font-size: 100%; + } +} + .menu-item, .list-item { display: block; @@ -397,10 +411,6 @@ nav { border: none; outline: none; text-align: initial; - font-size: inherit; - font-family: inherit; - font-weight: 400; - cursor: pointer; color: inherit; clear: both; position: relative; @@ -410,7 +420,6 @@ nav { border-width: 0; border-top-width: 1px; width: 100%; - line-height: var(--__line-height); padding: var(--__vertical-gap) var(--__horizontal-gap); background: transparent; @@ -450,10 +459,8 @@ nav { border: none; outline: none; display: inline; - font-size: 100%; font-family: inherit; line-height: unset; - color: var(--text); } &:first-child { diff --git a/src/components/draft/draft.js b/src/components/draft/draft.js index c32208021..e31d02964 100644 --- a/src/components/draft/draft.js +++ b/src/components/draft/draft.js @@ -3,6 +3,7 @@ import EditStatusForm from 'src/components/edit_status_form/edit_status_form.vue import ConfirmModal from 'src/components/confirm_modal/confirm_modal.vue' import StatusContent from 'src/components/status_content/status_content.vue' import Gallery from 'src/components/gallery/gallery.vue' +import { cloneDeep } from 'lodash' const Draft = { components: { @@ -19,8 +20,8 @@ const Draft = { } }, data () { - console.log('DRAFT', this.draft) return { + referenceDraft: cloneDeep(this.draft), editing: false, showingConfirmDialog: false } @@ -35,6 +36,11 @@ const Draft = { return {} } }, + safeToSave () { + return this.draft.status || + this.draft.files?.length || + this.draft.hasPoll + }, postStatusFormProps () { return { draftId: this.draft.id, @@ -48,7 +54,6 @@ const Draft = { return this.$store.getters.mergedConfig.collapseMessageWithSubject }, nsfwClickthrough () { - console.log(this.draft) if (!this.draft.nsfw) { return false } @@ -58,6 +63,16 @@ const Draft = { return true } }, + watch: { + editing (newVal) { + if (newVal) return + if (this.safeToSave) { + this.$store.dispatch('addOrSaveDraft', { draft: this.draft }) + } else { + this.$store.dispatch('addOrSaveDraft', { draft: this.referenceDraft }) + } + } + }, methods: { toggleEditing () { this.editing = !this.editing diff --git a/src/components/draft/draft.vue b/src/components/draft/draft.vue index 2e1937486..6ccf8695d 100644 --- a/src/components/draft/draft.vue +++ b/src/components/draft/draft.vue @@ -44,10 +44,12 @@
@@ -66,11 +68,10 @@
-
+