Merged filters into new settings dialog, added experimental summary field.

This commit is contained in:
DebaucheryLibrarian
2022-11-28 03:33:46 +01:00
parent 637669e3d1
commit b5e308562e
15 changed files with 740 additions and 72 deletions

View File

@@ -8,17 +8,10 @@
/>
<transition name="slide">
<Sidebar
v-if="showSidebar"
@toggle-sidebar="(state) => toggleSidebar(state)"
@show-filters="(state) => toggleFilters(state)"
/>
<Sidebar v-if="showSidebar" />
</transition>
<Header
@toggle-sidebar="(state) => toggleSidebar(state)"
@show-filters="(state) => toggleFilters(state)"
/>
<Header />
<p
v-if="config.showDisclaimer"
@@ -30,13 +23,18 @@
class="content"
@scroll="scroll"
>
<router-view @scroll="scrollToTop" />
<RouterView @scroll="scrollToTop" />
</div>
<Filters
v-if="showFilters"
@close="toggleFilters(false)"
/>
<Settings
v-if="showSettings"
@close="toggleSettings(false)"
/>
</div>
</template>
@@ -45,6 +43,7 @@ import Warning from './warning.vue';
import Header from '../header/header.vue';
import Sidebar from '../sidebar/sidebar.vue';
import Filters from '../filters/filters.vue';
import Settings from '../settings/settings.vue';
function toggleSidebar(state) {
this.showSidebar = typeof state === 'boolean' ? state : !this.showSidebar;
@@ -55,6 +54,11 @@ function toggleFilters(state) {
this.showSidebar = false;
}
function toggleSettings(state) {
this.showSettings = state;
this.showSidebar = false;
}
async function setConsent(consent, includeQueer) {
if (consent) {
this.showWarning = false;
@@ -88,6 +92,9 @@ function scrollToTop() {
function mounted() {
document.addEventListener('click', this.blur);
window.addEventListener('resize', this.resize);
this.events.on('toggleSettings', this.toggleSettings);
this.events.on('toggleSidebar', this.toggleSidebar);
}
function beforeUnmount() {
@@ -101,12 +108,14 @@ export default {
Sidebar,
Warning,
Filters,
Settings,
},
data() {
return {
showSidebar: false,
showWarning: localStorage.getItem('consent') !== window.env.sessionId,
showFilters: false,
showSettings: false,
selected: null,
};
},
@@ -115,6 +124,7 @@ export default {
methods: {
toggleSidebar,
toggleFilters,
toggleSettings,
setConsent,
blur,
resize,