2020-05-10 06:46:06 +03:00
|
|
|
import Modal from 'src/components/modal/modal.vue'
|
2020-05-26 23:58:55 +03:00
|
|
|
import PanelLoading from 'src/components/panel_loading/panel_loading.vue'
|
|
|
|
import AsyncComponentError from 'src/components/async_component_error/async_component_error.vue'
|
2020-05-25 16:11:05 +03:00
|
|
|
import getResettableAsyncComponent from 'src/services/resettable_async_component.js'
|
2020-05-03 17:36:12 +03:00
|
|
|
|
|
|
|
const SettingsModal = {
|
|
|
|
components: {
|
|
|
|
Modal,
|
2020-05-25 16:11:05 +03:00
|
|
|
SettingsModalContent: getResettableAsyncComponent(
|
|
|
|
() => import('./settings_modal_content.vue'),
|
|
|
|
{
|
2020-05-26 23:58:55 +03:00
|
|
|
loading: PanelLoading,
|
|
|
|
error: AsyncComponentError,
|
2020-05-25 16:32:32 +03:00
|
|
|
delay: 0
|
2020-05-25 16:11:05 +03:00
|
|
|
}
|
|
|
|
)
|
2020-05-03 17:36:12 +03:00
|
|
|
},
|
2020-05-26 23:58:55 +03:00
|
|
|
methods: {
|
|
|
|
closeModal () {
|
|
|
|
this.$store.dispatch('closeSettingsModal')
|
|
|
|
},
|
|
|
|
peekModal () {
|
|
|
|
this.$store.dispatch('togglePeekSettingsModal')
|
|
|
|
}
|
|
|
|
},
|
2020-05-03 17:36:12 +03:00
|
|
|
computed: {
|
2020-05-27 03:32:57 +03:00
|
|
|
currentSaveStateNotice () {
|
|
|
|
return this.$store.state.interface.settings.currentSaveStateNotice
|
|
|
|
},
|
2020-05-03 17:36:12 +03:00
|
|
|
modalActivated () {
|
|
|
|
return this.$store.state.interface.settingsModalState !== 'hidden'
|
2020-05-10 06:46:06 +03:00
|
|
|
},
|
2020-06-02 01:10:52 +03:00
|
|
|
modalOpenedOnce () {
|
|
|
|
return this.$store.state.interface.settingsModalLoaded
|
|
|
|
},
|
2020-05-10 06:46:06 +03:00
|
|
|
modalPeeked () {
|
|
|
|
return this.$store.state.interface.settingsModalState === 'minimized'
|
2020-05-03 17:36:12 +03:00
|
|
|
}
|
2020-07-21 14:53:01 +03:00
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
modalActivated (newValue) {
|
|
|
|
if (newValue) {
|
|
|
|
let html = document.querySelector('html')
|
|
|
|
if (html) {
|
|
|
|
html.classList.add('settings-modal-layout')
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
let html = document.querySelector('html')
|
|
|
|
if (html) {
|
|
|
|
html.classList.remove('settings-modal-layout')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-05-25 03:43:55 +03:00
|
|
|
}
|
2020-05-03 17:36:12 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
export default SettingsModal
|