mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 08:12:15 +00:00
refactor getDataByLocation helper, fix moveItem popup from File info panel
This commit is contained in:
@@ -129,7 +129,7 @@
|
||||
},
|
||||
moveItem() {
|
||||
// Move item fire popup
|
||||
events.$emit('popup:open', {name: 'move', item: this.fileInfoDetail[0]})
|
||||
events.$emit("popup:open", { name: "move", item: this.fileInfoDetail});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
31
resources/js/helpers.js
vendored
31
resources/js/helpers.js
vendored
@@ -308,27 +308,20 @@ const Helpers = {
|
||||
return validated
|
||||
}
|
||||
Vue.prototype.$getDataByLocation = function() {
|
||||
|
||||
let folder = store.getters.currentFolder
|
||||
|
||||
let actions = {
|
||||
'base' : ['getFolder', [{ folder: folder, back: true, init: false, sorting:true}]],
|
||||
'public' : ['browseShared', [{ folder: folder, back: true, init: false, sorting:true}]],
|
||||
'latest' : ['getLatest'],
|
||||
'shared' : ['getShared'],
|
||||
'trash-root' : ['getTrash'],
|
||||
'participant_uploads' : ['getParticipantUploads'],
|
||||
}
|
||||
|
||||
this.$store.dispatch(...actions[folder.location])
|
||||
|
||||
if(this.$isThisLocation('base') || this.$isThisLocation('public')){
|
||||
this.$store.dispatch('getFolder', [{ folder: folder, back: true, init: false, sorting:true}])
|
||||
}
|
||||
|
||||
if(this.$isThisLocation('latest')) {
|
||||
this.$store.dispatch('getLatest')
|
||||
}
|
||||
|
||||
if(this.$isThisLocation('shared')) {
|
||||
this.$store.dispatch('getShared')
|
||||
}
|
||||
|
||||
if(this.$isThisLocation('participant_uploads')) {
|
||||
this.$store.dispatch('getParticipantUploads')
|
||||
}
|
||||
|
||||
if(this.$isThisLocation('trash-root')) {
|
||||
this.$store.dispatch('getTrash')
|
||||
}
|
||||
// Get dara of user with favourites tree
|
||||
this.$store.dispatch('getAppData')
|
||||
|
||||
|
||||
6
resources/js/store/modules/sharing.js
vendored
6
resources/js/store/modules/sharing.js
vendored
@@ -32,7 +32,7 @@ const actions = {
|
||||
events.$emit('clear-query')
|
||||
}
|
||||
|
||||
if (! payload.back)
|
||||
if (! payload.back && !payload.sorting)
|
||||
commit('STORE_PREVIOUS_FOLDER', getters.currentFolder)
|
||||
|
||||
payload.folder.location = 'public'
|
||||
@@ -43,13 +43,13 @@ const actions = {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
axios
|
||||
.get(route)
|
||||
.get(route + getters.sorting.URI)
|
||||
.then(response => {
|
||||
commit('LOADING_STATE', {loading: false, data: response.data})
|
||||
commit('STORE_CURRENT_FOLDER', payload.folder)
|
||||
events.$emit('scrollTop')
|
||||
|
||||
if (payload.back)
|
||||
if (payload.back && !payload.sorting)
|
||||
commit('REMOVE_BROWSER_HISTORY')
|
||||
|
||||
resolve(response)
|
||||
|
||||
Reference in New Issue
Block a user