vuex refactoring

This commit is contained in:
carodej
2020-04-23 17:57:55 +02:00
parent 8cbc58f775
commit c4b26d70b5
18 changed files with 286 additions and 283 deletions

View File

@@ -160,7 +160,7 @@
},
ItemDetail() {
// Dispatch load file info detail
this.$store.dispatch('loadFileInfoDetail', this.item)
this.$store.commit('GET_FILEINFO_DETAIL', this.item)
// Show panel if is not open
this.$store.dispatch('fileInfoToggle', true)

View File

@@ -84,7 +84,7 @@
'currentFolder',
'browseHistory',
'homeDirectory',
'preview_type',
'FilePreviewType',
]),
directoryName() {
return this.currentFolder ? this.currentFolder.name : this.homeDirectory.name
@@ -95,7 +95,7 @@
return this.browseHistory[length] ? this.browseHistory[length] : this.homeDirectory
},
preview() {
return this.preview_type === 'list' ? 'th' : 'th-list'
return this.FilePreviewType === 'list' ? 'th' : 'th-list'
},
isTrash() {
return this.currentFolder.location === 'trash' || this.currentFolder.location === 'trash-root'
@@ -122,7 +122,7 @@
if ( this.$isThisLocation('public') ) {
this.$store.dispatch('browseShared', [this.previousFolder, true])
} else {
this.$store.dispatch('goToFolder', [this.previousFolder, true])
this.$store.dispatch('getFolder', [this.previousFolder, true])
}
}
},

View File

@@ -26,7 +26,7 @@
name="file"
tag="section"
class="file-list"
:class="preview_type"
:class="FilePreviewType"
>
<FileItemList
@dragstart="dragStart(item)"
@@ -46,7 +46,7 @@
name="file"
tag="section"
class="file-list"
:class="preview_type"
:class="FilePreviewType"
>
<FileItemGrid
@dragstart="dragStart(item)"
@@ -112,16 +112,16 @@
'fileInfoVisible',
'fileInfoDetail',
'currentFolder',
'preview_type',
'FilePreviewType',
'isSearching',
'isLoading',
'data'
]),
isGrid() {
return this.preview_type === 'grid'
return this.FilePreviewType === 'grid'
},
isList() {
return this.preview_type === 'list'
return this.FilePreviewType === 'list'
},
isEmpty() {
return this.data.length == 0

View File

@@ -80,7 +80,7 @@
name: 'FileItem',
props: ['data'],
computed: {
...mapGetters(['preview_type']),
...mapGetters(['FilePreviewType']),
isFolder() {
return this.data.type === 'folder'
},
@@ -113,7 +113,7 @@
methods: {
showItemActions() {
// Load file info detail
this.$store.dispatch('loadFileInfoDetail', this.data)
this.$store.commit('GET_FILEINFO_DETAIL', this.data)
events.$emit('mobileMenu:show')
},
@@ -139,12 +139,12 @@
if ( this.$isThisLocation('public') ) {
this.$store.dispatch('browseShared', [this.data, false])
} else {
this.$store.dispatch('goToFolder', [this.data, false])
this.$store.dispatch('getFolder', [this.data, false])
}
}
// Load file info detail
this.$store.dispatch('loadFileInfoDetail', this.data)
this.$store.commit('GET_FILEINFO_DETAIL', this.data)
// Get target classname
let itemClass = e.target.className
@@ -173,7 +173,7 @@
if ( this.$isThisLocation('public') ) {
this.$store.dispatch('browseShared', [this.data, false])
} else {
this.$store.dispatch('goToFolder', [this.data, false])
this.$store.dispatch('getFolder', [this.data, false])
}
}
},

View File

@@ -82,7 +82,7 @@
name: 'FileItem',
props: ['data'],
computed: {
...mapGetters(['preview_type']),
...mapGetters(['FilePreviewType']),
isFolder() {
return this.data.type === 'folder'
},
@@ -126,7 +126,7 @@
methods: {
showItemActions() {
// Load file info detail
this.$store.dispatch('loadFileInfoDetail', this.data)
this.$store.commit('GET_FILEINFO_DETAIL', this.data)
//this.isClicked = true
@@ -154,12 +154,12 @@
if ( this.$isThisLocation('public') ) {
this.$store.dispatch('browseShared', [this.data, false])
} else {
this.$store.dispatch('goToFolder', [this.data, false])
this.$store.dispatch('getFolder', [this.data, false])
}
}
// Load file info detail
this.$store.dispatch('loadFileInfoDetail', this.data)
this.$store.commit('GET_FILEINFO_DETAIL', this.data)
// Get target classname
let itemClass = e.target.className
@@ -188,7 +188,7 @@
if ( this.$isThisLocation('public') ) {
this.$store.dispatch('browseShared', [this.data, false])
} else {
this.$store.dispatch('goToFolder', [this.data, false])
this.$store.dispatch('getFolder', [this.data, false])
}
}
},

View File

@@ -52,12 +52,12 @@
UploadProgress,
},
computed: {
...mapGetters(['preview_type']),
...mapGetters(['FilePreviewType']),
previewIcon() {
return this.preview_type === 'list' ? 'th' : 'th-list'
return this.FilePreviewType === 'list' ? 'th' : 'th-list'
},
previewText() {
return this.preview_type === 'list' ? this.$t('preview_type.grid') : this.$t('preview_type.list')
return this.FilePreviewType === 'list' ? this.$t('preview_type.grid') : this.$t('preview_type.list')
}
},
methods: {

View File

@@ -39,11 +39,11 @@
computed: {
...mapGetters([
'fileInfoVisible',
'FilePreviewType',
'fileInfoDetail',
'currentFolder',
'browseHistory',
'homeDirectory',
'preview_type',
'appSize',
]),
directoryName() {
@@ -78,7 +78,7 @@
if ( this.$isThisLocation('public') ) {
this.$store.dispatch('browseShared', [this.previousFolder, false])
} else {
this.$store.dispatch('goToFolder', [this.previousFolder, false])
this.$store.dispatch('getFolder', [this.previousFolder, false])
}
}
},

View File

@@ -54,7 +54,7 @@
if ( this.$isThisLocation('public') ) {
this.$store.dispatch('browseShared', [this.currentFolder, true])
} else {
this.$store.dispatch('goToFolder', [this.currentFolder, true])
this.$store.dispatch('getFolder', [this.currentFolder, true])
}
}