FileSidebar refactored

This commit is contained in:
Peter Papp
2021-04-20 08:11:05 +02:00
parent 7e8511ab3f
commit 25a28c37c8
19 changed files with 697 additions and 830 deletions
+22 -18
View File
@@ -7,6 +7,28 @@ import axios from 'axios'
const Helpers = {
install(Vue) {
Vue.prototype.$searchFiles = debounce(function (value) {
if (value !== '' && typeof value !== 'undefined') {
this.$store.dispatch('getSearchResult', value)
} else if (typeof value !== 'undefined') {
if (this.$store.getters.currentFolder) {
// Get back after delete query to previously folder
if (this.$isThisLocation('public')) {
this.$store.dispatch('browseShared', [{folder: this.$store.getters.currentFolder, back: true, init: false}])
} else {
this.$store.dispatch('getFolder', [{folder: this.$store.getters.currentFolder, back: true, init: false}])
}
}
this.$store.commit('CHANGE_SEARCHING_STATE', false)
}
}, 300)
Vue.prototype.$updateText = debounce(function (route, name, value) {
let enableEmptyInput = ['mimetypes_blacklist', 'google_analytics', 'upload_limit']
@@ -253,24 +275,6 @@ const Helpers = {
})
}
Vue.prototype.$isMinimalScale = function () {
let sizeType = store.getters.filesViewWidth
return sizeType === 'minimal-scale'
}
Vue.prototype.$isCompactScale = function () {
let sizeType = store.getters.filesViewWidth
return sizeType === 'compact-scale'
}
Vue.prototype.$isFullScale = function () {
let sizeType = store.getters.filesViewWidth
return sizeType === 'full-scale'
}
Vue.prototype.$isSomethingWrong = function () {
events.$emit('alert:open', {
title: i18n.t('popup_error.title'),