$showMobileMenu helper implementation

This commit is contained in:
Čarodej
2021-10-29 11:51:46 +02:00
parent ce846cc076
commit 2d7b6e4e05
14 changed files with 61 additions and 52 deletions

View File

@@ -121,7 +121,7 @@
methods: {
showItemContextMenu() {
if (this.$isMobile()) {
events.$emit('mobile-menu:show', 'file-menu')
this.$showMobileMenu('file-menu')
} else {
events.$emit('popover:open', 'file-preview-contextmenu')
}

View File

@@ -157,7 +157,7 @@ export default {
this.$store.commit('CLIPBOARD_CLEAR')
this.$store.commit('ADD_ITEM_TO_CLIPBOARD', this.item)
events.$emit('mobile-menu:show', 'file-menu')
this.$showMobileMenu('file-menu')
},
dragEnter() {
if (this.item.type !== 'folder') return

View File

@@ -163,7 +163,7 @@
this.$store.commit('CLIPBOARD_CLEAR')
this.$store.commit('ADD_ITEM_TO_CLIPBOARD', this.entry)
events.$emit('mobile-menu:show', 'file-menu')
this.$showMobileMenu('file-menu')
events.$emit('mobile-context-menu:show', this.entry)
},
renameItem: debounce(function (e) {

View File

@@ -142,7 +142,7 @@
this.$store.commit('CLIPBOARD_CLEAR')
this.$store.commit('ADD_ITEM_TO_CLIPBOARD', this.entry)
events.$emit('mobile-menu:show', 'file-menu')
this.$showMobileMenu('file-menu')
events.$emit('mobile-context-menu:show', this.entry)
},
renameItem: debounce(function (e) {

View File

@@ -10,7 +10,7 @@
<div class="location-name">{{ title }}</div>
<!--More Actions-->
<div @click="showMobileNavigation" class="mobile-menu">
<div @click="$showMobileMenu('user-navigation')" class="mobile-menu">
<menu-icon size="17" class="icon" />
</div>
</header>
@@ -34,9 +34,6 @@
MenuIcon,
},
methods: {
showMobileNavigation() {
events.$emit('mobile-menu:show', 'user-navigation')
},
goBack() {
this.$router.back();
}

View File

@@ -377,23 +377,10 @@ const FunctionHelpers = {
events.$emit('spotlight:show')
}
Vue.prototype.$showLocations = function () {
events.$emit('mobile-menu:show', 'file-filter')
}
Vue.prototype.$createItems = function () {
events.$emit('mobile-menu:show', 'create-list')
}
Vue.prototype.$enableMultiSelectMode = function () {
this.$store.commit('TOGGLE_MULTISELECT_MODE')
}
Vue.prototype.$showViewOptions = function () {
events.$emit('mobile-menu:show', 'file-sorting')
}
// TODO: refactor other methods
Vue.prototype.$showMobileMenu = function (name) {
events.$emit('mobile-menu:show', name)
}

View File

@@ -83,16 +83,16 @@
<MobileActionButton @click.native="$openSpotlight" icon="search">
{{ $t('actions.search') }}
</MobileActionButton>
<MobileActionButton @click.native="$showLocations" icon="filter">
<MobileActionButton @click.native="$showMobileMenu('file-filter')" icon="filter">
{{ $getCurrentSectionName() }}
</MobileActionButton>
<MobileActionButton @click.native="$createItems" v-if="$checkPermission(['master', 'editor'])" icon="cloud-plus">
<MobileActionButton @click.native="$showMobileMenu('create-list')" v-if="$checkPermission(['master', 'editor'])" icon="cloud-plus">
{{ $t('mobile.create') }}
</MobileActionButton>
<MobileActionButton @click.native="$enableMultiSelectMode" icon="check-square">
{{ $t('context_menu.select') }}
</MobileActionButton>
<MobileActionButton @click.native="$showViewOptions" icon="preview-sorting">
<MobileActionButton @click.native="$showMobileMenu('file-sorting')" icon="preview-sorting">
{{ $t('preview_sorting.preview_sorting_button') }}
</MobileActionButton>
</FileActionsMobile>

View File

@@ -52,13 +52,13 @@
<MobileActionButton @click.native="$openSpotlight" icon="search">
{{ $t('actions.search')}}
</MobileActionButton>
<MobileActionButton @click.native="$showLocations" icon="filter">
<MobileActionButton @click.native="$showMobileMenu('file-filter')" icon="filter">
{{ $getCurrentSectionName() }}
</MobileActionButton>
<MobileActionButton @click.native="$enableMultiSelectMode" icon="check-square">
{{ $t('context_menu.select') }}
</MobileActionButton>
<MobileActionButton @click.native="$showViewOptions" icon="preview-sorting">
<MobileActionButton @click.native="$showMobileMenu('file-sorting')" icon="preview-sorting">
{{ $t('preview_sorting.preview_sorting_button') }}
</MobileActionButton>
</FileActionsMobile>

View File

@@ -76,13 +76,13 @@
<MobileActionButton @click.native="$openSpotlight" icon="search">
{{ $t('actions.search') }}
</MobileActionButton>
<MobileActionButton @click.native="$createItems" icon="cloud-plus">
<MobileActionButton @click.native="$showMobileMenu('create-list')" icon="cloud-plus">
{{ $t('mobile.create') }}
</MobileActionButton>
<MobileActionButton @click.native="$enableMultiSelectMode" icon="check-square">
{{ $t('context_menu.select') }}
</MobileActionButton>
<MobileActionButton @click.native="$showViewOptions" icon="preview-sorting">
<MobileActionButton @click.native="$showMobileMenu('file-sorting')" icon="preview-sorting">
{{ $t('preview_sorting.preview_sorting_button') }}
</MobileActionButton>
</template>
@@ -93,7 +93,7 @@
<MobileActionButton @click.native="$enableMultiSelectMode" icon="check-square">
{{ $t('context_menu.select') }}
</MobileActionButton>
<MobileActionButton @click.native="$showViewOptions" icon="preview-sorting">
<MobileActionButton @click.native="$showMobileMenu('file-sorting')" icon="preview-sorting">
{{ $t('preview_sorting.preview_sorting_button') }}
</MobileActionButton>
</template>

View File

@@ -43,7 +43,7 @@
<MobileActionButton @click.native="$openSpotlight" icon="search">
{{ $t('actions.search')}}
</MobileActionButton>
<MobileActionButton @click.native="$showLocations" icon="filter">
<MobileActionButton @click.native="$showMobileMenu('file-filter')" icon="filter">
{{ $getCurrentSectionName() }}
</MobileActionButton>
<MobileActionButtonUpload>
@@ -52,7 +52,7 @@
<MobileActionButton @click.native="$enableMultiSelectMode" icon="check-square">
{{ $t('context_menu.select') }}
</MobileActionButton>
<MobileActionButton @click.native="$showViewOptions" icon="preview-sorting">
<MobileActionButton @click.native="$showMobileMenu('file-sorting')" icon="preview-sorting">
{{ $t('preview_sorting.preview_sorting_button') }}
</MobileActionButton>
</FileActionsMobile>

View File

@@ -67,16 +67,16 @@
<MobileActionButton @click.native="$openSpotlight" icon="search">
{{ $t('actions.search') }}
</MobileActionButton>
<MobileActionButton @click.native="$showLocations" icon="filter">
<MobileActionButton @click.native="$showMobileMenu('file-filter')" icon="filter">
{{ $getCurrentSectionName() }}
</MobileActionButton>
<MobileActionButton v-if="canEdit" @click.native="$createItems" icon="cloud-plus">
<MobileActionButton v-if="canEdit" @click.native="$showMobileMenu('create-list')" icon="cloud-plus">
{{ $t('mobile.create') }}
</MobileActionButton>
<MobileActionButton @click.native="$enableMultiSelectMode" icon="check-square">
{{ $t('context_menu.select') }}
</MobileActionButton>
<MobileActionButton @click.native="$showViewOptions" icon="preview-sorting">
<MobileActionButton @click.native="$showMobileMenu('file-sorting')" icon="preview-sorting">
{{ $t('preview_sorting.preview_sorting_button') }}
</MobileActionButton>
</FileActionsMobile>

View File

@@ -91,16 +91,16 @@
<MobileActionButton @click.native="$openSpotlight" icon="search">
{{ $t('actions.search') }}
</MobileActionButton>
<MobileActionButton @click.native="$showLocations" icon="filter">
<MobileActionButton @click.native="$showMobileMenu('file-filter')" icon="filter">
{{ $getCurrentSectionName() }}
</MobileActionButton>
<MobileActionButton @click.native="$createItems" v-if="$checkPermission(['master', 'editor'])" icon="cloud-plus">
<MobileActionButton @click.native="$showMobileMenu('create-list')" v-if="$checkPermission(['master', 'editor'])" icon="cloud-plus">
{{ $t('mobile.create') }}
</MobileActionButton>
<MobileActionButton @click.native="$enableMultiSelectMode" icon="check-square">
{{ $t('context_menu.select') }}
</MobileActionButton>
<MobileActionButton @click.native="$showViewOptions" icon="preview-sorting">
<MobileActionButton @click.native="$showMobileMenu('file-sorting')" icon="preview-sorting">
{{ $t('preview_sorting.preview_sorting_button') }}
</MobileActionButton>
</FileActionsMobile>

View File

@@ -46,7 +46,7 @@
<MobileActionButton @click.native="$openSpotlight" icon="search">
{{ $t('actions.search')}}
</MobileActionButton>
<MobileActionButton @click.native="$showLocations" icon="filter">
<MobileActionButton @click.native="$showMobileMenu('file-filter')" icon="filter">
{{ $getCurrentSectionName() }}
</MobileActionButton>
<MobileActionButton @click.native="$emptyTrash" icon="trash">
@@ -55,7 +55,7 @@
<MobileActionButton @click.native="$enableMultiSelectMode" icon="check-square">
{{ $t('context_menu.select') }}
</MobileActionButton>
<MobileActionButton @click.native="$showViewOptions" icon="preview-sorting">
<MobileActionButton @click.native="$showMobileMenu('file-sorting')" icon="preview-sorting">
{{ $t('preview_sorting.preview_sorting_button') }}
</MobileActionButton>
</FileActionsMobile>