This commit is contained in:
CTXP 2024-05-01 10:00:48 +00:00 committed by GitHub
commit ccfe30de38
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 34 additions and 6 deletions

View File

@ -1,6 +1,6 @@
{
"name": "dashy",
"version": "3.0.1",
"version": "3.0.2",
"license": "MIT",
"main": "server",
"author": "Alicia Sykes <alicia@omg.lol> (https://aliciasykes.com)",

View File

@ -6,6 +6,7 @@
]"
:style="`${color ? 'background: '+color : ''}; ${sanitizeCustomStyles(customStyles)};`"
>
<input
:id="sectionKey"
class="toggle"
@ -13,14 +14,17 @@
v-model="checkboxState"
tabIndex="-1"
>
<label :for="sectionKey" class="lbl-toggle" tabindex="-1"
@mouseup.right="openContextMenu" @contextmenu.prevent
@long-press="openContextMenu" v-longPress="500">
<label :for="hideCollapse() ? sectionKey : null" class="lbl-toggle" tabindex="-1"
@mouseup.right="hideEditing() ? null : openContextMenu"
@contextmenu.prevent
@long-press="hideEditing() ? null : openContextMenu"
v-longPress="500">
<Icon v-if="icon" :icon="icon" size="small" :url="title" class="section-icon" />
<h3>{{ title }}</h3>
<EditModeIcon v-if="isEditMode" @click="openEditModal"
v-tooltip="editTooltip()" class="edit-mode-item" />
<OpenIcon @click.prevent.stop="openContextMenu" @contextmenu.prevent
<OpenIcon v-if="hideEditing()" @click.prevent.stop="openContextMenu" @contextmenu.prevent
class="edit-mode-item" />
</label>
<div class="collapsible-content">
@ -155,6 +159,12 @@ export default {
const content = this.$t('interactive-editor.edit-section.edit-tooltip');
return { content, trigger: 'hover focus', delay: { show: 100, hide: 0 } };
},
hideEditing() {
return this.$store.getters.visibleComponents.editing;
},
hideCollapse() {
return this.$store.getters.visibleComponents.collapse;
},
},
};
</script>

View File

@ -4,7 +4,7 @@
@user-is-searchin="userIsTypingSomething"
v-if="searchVisible"
/>
<div class="options-outer">
<div class="options-outer" v-if="settingsVisible">
<div :class="`options-container ${!settingsVisible ? 'hide' : ''}`">
<ThemeSelector />
<LayoutSelector :displayLayout="$store.getters.layout" />

View File

@ -61,6 +61,10 @@ export const componentVisibility = (appConfig) => {
const isThere = (userValue) => typeof userValue === 'boolean';
// For each option, return users choice (if specified), else use the default
return {
collapse: isThere(usersChoice.hideCollapse)
? !usersChoice.hideCollapse : visibleComponents.hideCollapse,
editing: isThere(usersChoice.hideEditing)
? !usersChoice.hideEditing : visibleComponents.hideEditing,
pageTitle: isThere(usersChoice.hideHeading)
? !usersChoice.hideHeading : visibleComponents.pageTitle,
navigation: isThere(usersChoice.hideNav)

View File

@ -453,6 +453,18 @@
"type": "object",
"description": "Hide individual parts of the page. If not set, all components are visible by default",
"properties": {
"hideCollapse": {
"title": "Hide Collapse?",
"type": "boolean",
"default": "false",
"description": "If set to true, sections will not be able to collapse"
},
"hideEditing": {
"title": "Hide Editing?",
"type": "boolean",
"default": "false",
"description": "If set to true, sections will no longer have a options icon"
},
"hideHeading": {
"title": "Hide Heading?",
"type": "boolean",

View File

@ -115,6 +115,8 @@ module.exports = {
hideFurnitureOn: ['minimal', 'login', 'download'],
/* Key names for local storage identifiers */
localStorageKeys: {
HIDE_COLLAPSE: 'hideCollapse',
HIDE_EDITING: 'hideEditing',
LANGUAGE: 'language',
HIDE_INFO_NOTIFICATION: 'hideWelcomeHelpers',
LAYOUT_ORIENTATION: 'layoutOrientation',