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 cb07ec5c5..e31d02964 100644 --- a/src/components/draft/draft.js +++ b/src/components/draft/draft.js @@ -2,13 +2,16 @@ import PostStatusForm from 'src/components/post_status_form/post_status_form.vue 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: { PostStatusForm, EditStatusForm, ConfirmModal, - StatusContent + StatusContent, + Gallery }, props: { draft: { @@ -18,6 +21,7 @@ const Draft = { }, data () { return { + referenceDraft: cloneDeep(this.draft), editing: false, showingConfirmDialog: false } @@ -32,6 +36,11 @@ const Draft = { return {} } }, + safeToSave () { + return this.draft.status || + this.draft.files?.length || + this.draft.hasPoll + }, postStatusFormProps () { return { draftId: this.draft.id, @@ -40,6 +49,28 @@ const Draft = { }, refStatus () { return this.draft.refId ? this.$store.state.statuses.allStatusesObject[this.draft.refId] : undefined + }, + localCollapseSubjectDefault () { + return this.$store.getters.mergedConfig.collapseMessageWithSubject + }, + nsfwClickthrough () { + if (!this.draft.nsfw) { + return false + } + if (this.draft.summary && this.localCollapseSubjectDefault) { + return false + } + 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: { diff --git a/src/components/draft/draft.vue b/src/components/draft/draft.vue index d462045ed..6ccf8695d 100644 --- a/src/components/draft/draft.vue +++ b/src/components/draft/draft.vue @@ -26,15 +26,30 @@ :compact="true" /> -

{{ draft.status }}

+
+

{{ draft.status }}

+ +
@@ -53,11 +68,10 @@
-
+