Merge branch 'master' of github.com:Lissy93/dashy into FEATURE/sub-items

This commit is contained in:
Alicia Sykes
2022-02-15 11:12:42 +00:00
46 changed files with 963 additions and 309 deletions

View File

@@ -29,7 +29,7 @@
</li>
</ul>
<!-- Edit Options -->
<ul class="menu-section">
<ul class="menu-section" v-bind:class="{ disabled: !isEditAllowed }">
<li class="section-title">
{{ $t('context-menus.item.options-section-title') }}
</li>
@@ -85,6 +85,9 @@ export default {
isEditMode() {
return this.$store.state.editMode;
},
isEditAllowed() {
return this.$store.getters.permissions.allowViewConfig;
},
},
methods: {
/* Called on item click, emits an event up to Item */
@@ -93,13 +96,19 @@ export default {
this.$emit('launchItem', target);
},
openSettings() {
this.$emit('openItemSettings');
if (this.isEditAllowed) {
this.$emit('openItemSettings');
}
},
openMoveMenu() {
this.$emit('openMoveItemMenu');
if (this.isEditAllowed) {
this.$emit('openMoveItemMenu');
}
},
openDeleteItem() {
this.$emit('openDeleteItem');
if (this.isEditAllowed) {
this.$emit('openDeleteItem');
}
},
},
};
@@ -149,6 +158,13 @@ div.context-menu {
path { fill: currentColor; }
}
}
&.disabled li:not(.section-title) {
cursor: not-allowed;
opacity: var(--dimming-factor);
&:hover {
background: var(--context-menu-background);
}
}
}
}

View File

@@ -259,6 +259,10 @@ export default {
},
/* Navigate to the section's single-section view page */
navigateToSection() {
if (!this.title) {
ErrorHandler('Cannot open section without a valid name');
return;
}
const parse = (section) => section.replace(' ', '-').toLowerCase().trim();
const sectionIdentifier = parse(this.title);
router.push({ path: `/home/${sectionIdentifier}` });