55<template >
66 <NcAppContent :page-heading =" pageHeading" data-cy-files-content >
77 <div class =" files-list__header" :class =" { 'files-list__header--public': isPublic }" >
8+ <!-- Uploader -->
9+ <component :is =" isNarrow ? 'Teleport' : 'div'" :to =" isNarrow ? 'body' : undefined" >
10+ <UploadPicker
11+ v-if =" canUpload && !isQuotaExceeded && currentFolder"
12+ allow-folders
13+ :no-label =" isNarrow"
14+ class =" files-list__header-upload-button"
15+ :class =" { 'files-list__header-upload-button--narrow': isNarrow }"
16+ :content =" getContent"
17+ :destination =" currentFolder"
18+ :forbidden-characters =" forbiddenCharacters"
19+ multiple
20+ primary
21+ @failed =" onUploadFail"
22+ @uploaded =" onUpload" />
23+ </component >
24+
825 <!-- Current folder breadcrumbs -->
9- <BreadCrumbs :path =" directory" @reload =" fetchContent" >
10- <template #actions >
11- <!-- Uploader -->
12- <UploadPicker
13- v-if =" canUpload && !isQuotaExceeded && currentFolder"
14- allow-folders
15- :no-label =" isNarrow"
16- class =" files-list__header-upload-button"
17- :content =" getContent"
18- :destination =" currentFolder"
19- :forbidden-characters =" forbiddenCharacters"
20- multiple
21- @failed =" onUploadFail"
22- @uploaded =" onUpload" />
23- </template >
24- </BreadCrumbs >
26+ <BreadCrumbs :path =" directory" @reload =" fetchContent" />
2527
26- <!-- Secondary loading indicator -->
27- <NcLoadingIcon v-if =" isRefreshing" class =" files-list__refresh-icon" />
28+ <!-- Loading indicator -->
29+ <NcLoadingIcon
30+ v-if =" isRefreshing"
31+ class =" files-list__refresh-icon"
32+ :name =" t('files', 'File list is reloading')" />
2833
34+ <!-- File list actions (global actions like restore all files from trashbin) -->
2935 <NcActions
3036 class =" files-list__header-actions"
3137 :inline =" 1"
4854 </NcActionButton >
4955 </NcActions >
5056
57+ <!-- Filters thats can be applied to the file list -->
5158 <FileListFilters />
5259
60+ <!-- Grid view toggle -->
5361 <NcButton
5462 v-if =" enableGridView"
5563 :aria-label =" gridViewButtonLabel"
@@ -165,6 +173,7 @@ import { UploadPicker, UploadStatus } from '@nextcloud/upload'
165173import { useThrottleFn } from ' @vueuse/core'
166174import { normalize , relative } from ' path'
167175import { computed , defineComponent } from ' vue'
176+ import Teleport from ' vue2-teleport' // TODO: replace with native Vue Teleport when we switch to Vue 3
168177import NcActionButton from ' @nextcloud/vue/components/NcActionButton'
169178import NcActions from ' @nextcloud/vue/components/NcActions'
170179import NcAppContent from ' @nextcloud/vue/components/NcAppContent'
@@ -213,6 +222,7 @@ export default defineComponent({
213222 NcEmptyContent ,
214223 NcIconSvgWrapper ,
215224 NcLoadingIcon ,
225+ Teleport ,
216226 UploadPicker ,
217227 ViewGridIcon ,
218228 IconAlertCircleOutline ,
@@ -776,6 +786,7 @@ export default defineComponent({
776786.files-list {
777787 & __header {
778788 display : flex ;
789+ gap : var (--default-grid-baseline );
779790 align-items : center ;
780791 // Do not grow or shrink (vertically)
781792 flex : 0 0 ;
@@ -797,10 +808,16 @@ export default defineComponent({
797808
798809 & -actions {
799810 min-width : fit-content !important ;
800- margin-inline : calc (var (--default-grid-baseline ) * 2 );
801811 }
802812 }
803813
814+ & __header-upload-button--narrow {
815+ // this is teleported to body on narrow screens
816+ position : fixed ;
817+ inset-block-end : calc (1.5 * var (--default-grid-baseline ));
818+ inset-inline-end : calc (1.5 * var (--default-grid-baseline ));
819+ }
820+
804821 & __before {
805822 display : flex ;
806823 flex-direction : column ;
0 commit comments