aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2023-10-17 12:00:46 +0200
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-10-17 12:43:25 +0200
commit1ba5bc08ab84bc8cd726fe9f020dee1c8b181378 (patch)
tree142c62b50873543602df6d2b0229f43e7232a104 /apps/files/src
parent77fdef108194cff1cfb302d8ea129e22832be099 (diff)
downloadnextcloud-server-1ba5bc08ab84bc8cd726fe9f020dee1c8b181378.tar.gz
nextcloud-server-1ba5bc08ab84bc8cd726fe9f020dee1c8b181378.zip
fix(files): hide grid view button on narrow screen
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files/src')
-rw-r--r--apps/files/src/mixins/filesListWidth.ts2
-rw-r--r--apps/files/src/views/FilesList.vue5
2 files changed, 5 insertions, 2 deletions
diff --git a/apps/files/src/mixins/filesListWidth.ts b/apps/files/src/mixins/filesListWidth.ts
index a2bb6b486bc..211ac881540 100644
--- a/apps/files/src/mixins/filesListWidth.ts
+++ b/apps/files/src/mixins/filesListWidth.ts
@@ -28,7 +28,7 @@ export default Vue.extend({
filesListWidth: null as number | null,
}
},
- created() {
+ mounted() {
const fileListEl = document.querySelector('#app-content-vue')
this.$resizeObserver = new ResizeObserver((entries) => {
if (entries.length > 0 && entries[0].target === fileListEl) {
diff --git a/apps/files/src/views/FilesList.vue b/apps/files/src/views/FilesList.vue
index f7c648fcd2e..791a259fd1b 100644
--- a/apps/files/src/views/FilesList.vue
+++ b/apps/files/src/views/FilesList.vue
@@ -46,7 +46,8 @@
</template>
</BreadCrumbs>
- <NcButton :aria-label="gridViewButtonLabel"
+ <NcButton v-if="filesListWidth >= 512"
+ :aria-label="gridViewButtonLabel"
:title="gridViewButtonLabel"
class="files-list__header-grid-button"
type="tertiary"
@@ -129,6 +130,7 @@ import { useUserConfigStore } from '../store/userconfig.ts'
import { useViewConfigStore } from '../store/viewConfig.ts'
import BreadCrumbs from '../components/BreadCrumbs.vue'
import FilesListVirtual from '../components/FilesListVirtual.vue'
+import filesListWidthMixin from '../mixins/filesListWidth.ts'
import filesSortingMixin from '../mixins/filesSorting.ts'
import logger from '../logger.js'
@@ -153,6 +155,7 @@ export default Vue.extend({
},
mixins: [
+ filesListWidthMixin,
filesSortingMixin,
],