✨ Expand collapse section from context menu (#660)
This commit is contained in:
@@ -94,6 +94,7 @@
|
||||
v-click-outside="closeContextMenu"
|
||||
@openEditSection="openEditSection"
|
||||
@navigateToSection="navigateToSection"
|
||||
@expandCollapseSection="expandCollapseSection"
|
||||
@removeSection="removeSection"
|
||||
/>
|
||||
</Collapsable>
|
||||
@@ -250,6 +251,12 @@ export default {
|
||||
router.push({ path: `/home/${sectionIdentifier}` });
|
||||
this.closeContextMenu();
|
||||
},
|
||||
/* Toggle sections collapse state */
|
||||
expandCollapseSection() {
|
||||
const secElem = this.$refs[this.sectionRef];
|
||||
if (secElem) secElem.toggle();
|
||||
this.closeContextMenu();
|
||||
},
|
||||
/* Open the Section Edit Menu */
|
||||
openEditSection() {
|
||||
this.editMenuOpen = true;
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
<EditIcon />
|
||||
<span>{{ $t('context-menus.section.edit-section') }}</span>
|
||||
</li>
|
||||
<li @click="expandCollapseSection">
|
||||
<ExpandCollapseIcon />
|
||||
<span>{{ $t('context-menus.section.expand-collapse') }}</span>
|
||||
</li>
|
||||
<li v-if="isEditMode" @click="removeSection">
|
||||
<BinIcon />
|
||||
<span>{{ $t('context-menus.section.remove-section') }}</span>
|
||||
@@ -26,6 +30,7 @@
|
||||
import EditIcon from '@/assets/interface-icons/config-edit-json.svg';
|
||||
import BinIcon from '@/assets/interface-icons/interactive-editor-remove.svg';
|
||||
import SameTabOpenIcon from '@/assets/interface-icons/open-current-tab.svg';
|
||||
import ExpandCollapseIcon from '@/assets/interface-icons/section-expand-collapse.svg';
|
||||
|
||||
export default {
|
||||
name: 'ContextMenu',
|
||||
@@ -33,6 +38,7 @@ export default {
|
||||
EditIcon,
|
||||
BinIcon,
|
||||
SameTabOpenIcon,
|
||||
ExpandCollapseIcon,
|
||||
},
|
||||
props: {
|
||||
posX: Number, // The X coordinate for positioning
|
||||
@@ -56,6 +62,9 @@ export default {
|
||||
openEditSectionMenu() {
|
||||
this.$emit('openEditSection');
|
||||
},
|
||||
expandCollapseSection() {
|
||||
this.$emit('expandCollapseSection');
|
||||
},
|
||||
removeSection() {
|
||||
this.$emit('removeSection');
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user