mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-28 19:10:40 +00:00
spotlight tweaks
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
<ToolbarGroup v-if="$checkPermission(['master', 'editor']) && ! $isThisRoute($route, ['SharedWithMe'])">
|
||||
|
||||
<span class="lg:hidden block">
|
||||
<ToolbarButton @click.stop.native="$openSpotlight" source="search" :action="$t('Search files or folders')" />
|
||||
<ToolbarButton @click.stop.native="$openSpotlight()" source="search" :action="$t('Search files or folders')" />
|
||||
</span>
|
||||
|
||||
<PopoverWrapper>
|
||||
@@ -45,7 +45,7 @@
|
||||
<!--Create button for shared with me page-->
|
||||
<ToolbarGroup v-if="$isThisRoute($route, ['SharedWithMe'])">
|
||||
<span class="lg:hidden block">
|
||||
<ToolbarButton @click.stop.native="$openSpotlight" source="search" :action="$t('Search files or folders')" />
|
||||
<ToolbarButton @click.stop.native="$openSpotlight()" source="search" :action="$t('Search files or folders')" />
|
||||
</span>
|
||||
|
||||
<PopoverWrapper>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div @click="$openSpotlight" class="relative dark:bg-dark-foreground bg-light-background rounded-lg cursor-pointer">
|
||||
<div @click="$openSpotlight()" class="relative dark:bg-dark-foreground bg-light-background rounded-lg cursor-pointer">
|
||||
<div class="flex justify-between items-center px-5 py-2.5 xl:w-72 w-56 text-left">
|
||||
<div class="flex items-center">
|
||||
<search-icon size="18" class="vue-feather dark:text-gray-600 text-gray-400" />
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
<b v-if="actions.length !== 0" class="text-xs text-gray-500 mb-1.5 block">
|
||||
{{ $t('Actions') }}
|
||||
</b>
|
||||
<div v-if="actions.length !== 0" v-for="(result, i) in actions" :key="i" class="relative">
|
||||
<div v-if="actions.length !== 0" v-for="(result, i) in actions" :key="result.action.value" class="relative">
|
||||
|
||||
<div
|
||||
class="flex items-center px-3.5 py-2.5"
|
||||
@@ -82,7 +82,7 @@
|
||||
<b v-if="! activeFilter" class="text-xs text-gray-500 mb-1.5 block mt-3">
|
||||
{{ $t('Files & Folders') }}
|
||||
</b>
|
||||
<div v-if="results.length !== 0" v-for="(result, i) in results" :key="(i + actions.length)" class="relative">
|
||||
<div v-if="results.length !== 0" v-for="(result, i) in results" :key="result.data.id" class="relative">
|
||||
|
||||
<!--Users result-->
|
||||
<div
|
||||
@@ -126,12 +126,32 @@
|
||||
{{ $t('messages.nothing_was_found') }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!--Hints-->
|
||||
<div v-if="! $isMobile()" class="flex items-center px-5 pb-2">
|
||||
<div class="flex items-center mr-4">
|
||||
<ArrowUpIcon size="12" class="vue-feather text-gray-400"/>
|
||||
<ArrowDownIcon size="12" class="vue-feather text-gray-400"/>
|
||||
|
||||
<span class="text-xs ml-1.5 text-gray-400">
|
||||
{{ $t('Navigate') }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center">
|
||||
<CornerDownLeftIcon size="12" class="vue-feather text-gray-400"/>
|
||||
|
||||
<span class="text-xs ml-1.5 text-gray-400">
|
||||
{{ $t('Go') }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {DatabaseIcon, SearchIcon, Trash2Icon, UserPlusIcon, XIcon, HomeIcon, SettingsIcon} from 'vue-feather-icons'
|
||||
import {DatabaseIcon, SearchIcon, Trash2Icon, UserPlusIcon, XIcon, HomeIcon, SettingsIcon, ArrowUpIcon, ArrowDownIcon, CornerDownLeftIcon} from 'vue-feather-icons'
|
||||
import Spinner from '/resources/js/components/FilesView/Spinner'
|
||||
import MemberAvatar from "../FilesView/MemberAvatar"
|
||||
import ItemList from "../FilesView/ItemList"
|
||||
@@ -161,7 +181,7 @@ export default {
|
||||
|
||||
// Browse actions
|
||||
if (! this.activeFilter) {
|
||||
this.actions = this.actionList.filter(el => el.title.toLowerCase().indexOf(query) > -1)
|
||||
this.actions = this.actionList.filter(el => el.title.toLowerCase().indexOf(query) > -1).slice(0, 3)
|
||||
}
|
||||
|
||||
this.findResult(query)
|
||||
@@ -174,8 +194,10 @@ export default {
|
||||
e.preventDefault()
|
||||
}
|
||||
|
||||
const allowedRange = this.results.length + this.actions.length
|
||||
|
||||
// Allow only numbers within result range
|
||||
if (Number.isInteger(parseInt(e.key)) && parseInt(e.key) < this.results.length) {
|
||||
if (Number.isInteger(parseInt(e.key)) && parseInt(e.key) < allowedRange) {
|
||||
this.index = parseInt(e.key)
|
||||
|
||||
this.showSelected()
|
||||
@@ -327,6 +349,9 @@ export default {
|
||||
},
|
||||
},
|
||||
components: {
|
||||
CornerDownLeftIcon,
|
||||
ArrowDownIcon,
|
||||
ArrowUpIcon,
|
||||
SettingsIcon,
|
||||
HomeIcon,
|
||||
DatabaseIcon,
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
</ContextMenu>
|
||||
|
||||
<FileActionsMobile>
|
||||
<MobileActionButton @click.native="$openSpotlight" icon="search">
|
||||
<MobileActionButton @click.native="$openSpotlight()" icon="search">
|
||||
{{ $t('Spotlight') }}
|
||||
</MobileActionButton>
|
||||
<MobileActionButton @click.native="$showMobileMenu('file-filter')" :icon="$getCurrentSectionIcon()">
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
</MobileContextMenu>
|
||||
|
||||
<FileActionsMobile>
|
||||
<MobileActionButton @click.native="$openSpotlight" icon="search">
|
||||
<MobileActionButton @click.native="$openSpotlight()" icon="search">
|
||||
{{ $t('Spotlight')}}
|
||||
</MobileActionButton>
|
||||
<MobileActionButton @click.native="$showMobileMenu('file-filter')" :icon="$getCurrentSectionIcon()">
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
|
||||
<FileActionsMobile>
|
||||
<template v-if="$checkPermission('editor')">
|
||||
<MobileActionButton @click.native="$openSpotlight" icon="search">
|
||||
<MobileActionButton @click.native="$openSpotlight()" icon="search">
|
||||
{{ $t('Spotlight') }}
|
||||
</MobileActionButton>
|
||||
<MobileActionButton @click.native="$showMobileMenu('create-list')" icon="cloud-plus">
|
||||
@@ -87,7 +87,7 @@
|
||||
</MobileActionButton>
|
||||
</template>
|
||||
<template v-if="$checkPermission('visitor')">
|
||||
<MobileActionButton @click.native="$openSpotlight" icon="search">
|
||||
<MobileActionButton @click.native="$openSpotlight()" icon="search">
|
||||
{{ $t('Spotlight')}}
|
||||
</MobileActionButton>
|
||||
<MobileActionButton @click.native="$enableMultiSelectMode" icon="check-square">
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
</MobileContextMenu>
|
||||
|
||||
<FileActionsMobile>
|
||||
<MobileActionButton @click.native="$openSpotlight" icon="search">
|
||||
<MobileActionButton @click.native="$openSpotlight()" icon="search">
|
||||
{{ $t('Spotlight') }}
|
||||
</MobileActionButton>
|
||||
<MobileActionButton @click.native="$showMobileMenu('file-filter')" :icon="$getCurrentSectionIcon()">
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
</ContextMenu>
|
||||
|
||||
<FileActionsMobile>
|
||||
<MobileActionButton @click.native="$openSpotlight" icon="search">
|
||||
<MobileActionButton @click.native="$openSpotlight()" icon="search">
|
||||
{{ $t('Spotlight') }}
|
||||
</MobileActionButton>
|
||||
<MobileActionButton @click.native="$showMobileMenu('file-filter')" :icon="$getCurrentSectionIcon()">
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
</ContextMenu>
|
||||
|
||||
<FileActionsMobile>
|
||||
<MobileActionButton @click.native="$openSpotlight" icon="search">
|
||||
<MobileActionButton @click.native="$openSpotlight()" icon="search">
|
||||
{{ $t('Spotlight') }}
|
||||
</MobileActionButton>
|
||||
<MobileActionButton @click.native="$showMobileMenu('file-filter')" :icon="$getCurrentSectionIcon()">
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
</MobileContextMenu>
|
||||
|
||||
<FileActionsMobile>
|
||||
<MobileActionButton @click.native="$openSpotlight" icon="search">
|
||||
<MobileActionButton @click.native="$openSpotlight()" icon="search">
|
||||
{{ $t('Spotlight')}}
|
||||
</MobileActionButton>
|
||||
<MobileActionButton @click.native="$showMobileMenu('file-filter')" :icon="$getCurrentSectionIcon()">
|
||||
|
||||
Reference in New Issue
Block a user