aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src/components/FileEntry.vue
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2023-04-12 17:53:38 +0200
committerGitHub <noreply@github.com>2023-04-12 17:53:38 +0200
commitf37b29eb2da66c66fd3752209c9e552948e35ca1 (patch)
tree3c83ccfc23fdc2be64c35a43499bf67905b019a3 /apps/files/src/components/FileEntry.vue
parentfe2e0a5cd70ab04c5447cde10926224805cc32bf (diff)
parent306bc2a74be9b50d26ad152cbb23150f23ee078c (diff)
downloadnextcloud-server-f37b29eb2da66c66fd3752209c9e552948e35ca1.tar.gz
nextcloud-server-f37b29eb2da66c66fd3752209c9e552948e35ca1.zip
Merge pull request #37642 from nextcloud/fix/reactivity-files
Diffstat (limited to 'apps/files/src/components/FileEntry.vue')
-rw-r--r--apps/files/src/components/FileEntry.vue26
1 files changed, 18 insertions, 8 deletions
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue
index 337e4c7b6ac..d485d9d78df 100644
--- a/apps/files/src/components/FileEntry.vue
+++ b/apps/files/src/components/FileEntry.vue
@@ -1,7 +1,7 @@
<!--
- - @copyright Copyright (c) 2019 Gary Kim <gary@garykim.dev>
+ - @copyright Copyright (c) 2023 John Molakvoæ <skjnldsv@protonmail.com>
-
- - @author Gary Kim <gary@garykim.dev>
+ - @author John Molakvoæ <skjnldsv@protonmail.com>
-
- @license GNU AGPL version 3 or any later version
-
@@ -115,6 +115,7 @@ import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
+import isMobileMixin from '@nextcloud/vue/dist/Mixins/isMobile.js'
import Vue from 'vue'
import { getFileActions } from '../services/FileAction.ts'
@@ -146,6 +147,10 @@ export default Vue.extend({
NcLoadingIcon,
},
+ mixins: [
+ isMobileMixin,
+ ],
+
props: {
active: {
type: Boolean,
@@ -295,13 +300,20 @@ export default Vue.extend({
},
enabledInlineActions() {
+ if (this.isMobile) {
+ return []
+ }
return this.enabledActions.filter(action => action?.inline?.(this.source, this.currentView))
},
enabledMenuActions() {
+ if (this.isMobile) {
+ return this.enabledActions
+ }
+
return [
...this.enabledInlineActions,
- ...actions.filter(action => !action.inline),
+ ...this.enabledActions.filter(action => !action.inline),
]
},
@@ -311,10 +323,10 @@ export default Vue.extend({
openedMenu: {
get() {
- return this.actionsMenuStore.opened === this
+ return this.actionsMenuStore.opened === this.uniqueId
},
set(opened) {
- this.actionsMenuStore.opened = opened ? this : null
+ this.actionsMenuStore.opened = opened ? this.uniqueId : null
},
},
},
@@ -515,7 +527,7 @@ export default Vue.extend({
// If the clicked row is in the selection, open global menu
const isMoreThanOneSelected = this.selectedFiles.length > 1
- this.actionsMenuStore.opened = this.isSelected && isMoreThanOneSelected ? 'global' : this
+ this.actionsMenuStore.opened = this.isSelected && isMoreThanOneSelected ? 'global' : this.uniqueId
// Prevent any browser defaults
event.preventDefault()
@@ -529,8 +541,6 @@ export default Vue.extend({
</script>
<style scoped lang='scss'>
-@import '../mixins/fileslist-row.scss';
-
/* Hover effect on tbody lines only */
tr {
&:hover,