mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-21 09:12:14 +00:00
Helper methods refactoring
This commit is contained in:
25
resources/js/helpers.js
vendored
25
resources/js/helpers.js
vendored
@@ -7,28 +7,11 @@ import axios from 'axios'
|
||||
const Helpers = {
|
||||
install(Vue) {
|
||||
|
||||
Vue.prototype.$searchInvoices = debounce(function (value) {
|
||||
Vue.prototype.$showSidebarPreview = function (entry) {
|
||||
this.$store.commit('ADD_ITEM_TO_CLIPBOARD', entry)
|
||||
|
||||
if (value !== '' && typeof value !== 'undefined') {
|
||||
|
||||
if (['regular-invoice', 'advance-invoice'].includes(this.$store.getters.currentFolder.location)) {
|
||||
this.$store.dispatch('getSearchResultForInvoices', value)
|
||||
} else {
|
||||
this.$store.dispatch('getSearchResultForClients', value)
|
||||
}
|
||||
} else if (typeof value !== 'undefined') {
|
||||
|
||||
let locations = {
|
||||
'regular-invoice': 'getRegularInvoices',
|
||||
'advance-invoice': 'getAdvanceInvoices',
|
||||
'clients': 'getClients',
|
||||
}
|
||||
|
||||
this.$store.dispatch(locations[this.$store.getters.currentFolder.location])
|
||||
|
||||
this.$store.commit('CHANGE_SEARCHING_STATE', false)
|
||||
}
|
||||
}, 300)
|
||||
this.$store.dispatch('fileInfoToggle', true)
|
||||
}
|
||||
|
||||
Vue.prototype.$renameFileOrFolder = function (entry) {
|
||||
events.$emit('popup:open', {name: 'rename-item', item: entry})
|
||||
|
||||
Reference in New Issue
Block a user