mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 00:02:15 +00:00
$showMobileMenu helper implementation
This commit is contained in:
@@ -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')
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
13
resources/js/helpers/functionHelpers.js
vendored
13
resources/js/helpers/functionHelpers.js
vendored
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user