mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-19 00:22:15 +00:00
- added file resource
- frontend refactoring
This commit is contained in:
8
resources/js/helpers/functionHelpers.js
vendored
8
resources/js/helpers/functionHelpers.js
vendored
@@ -89,14 +89,14 @@ const FunctionHelpers = {
|
||||
|
||||
Vue.prototype.$uploadFiles = async function (files) {
|
||||
|
||||
if (files.length == 0) return
|
||||
if (files.length === 0) return
|
||||
|
||||
if (!this.$checkFileMimetype(files) || !this.$checkUploadLimit(files)) return
|
||||
|
||||
// Push items to file queue
|
||||
[...files].map(item => {
|
||||
this.$store.commit('ADD_FILES_TO_QUEUE', {
|
||||
folder_id: store.getters.currentFolder.id ? store.getters.currentFolder.id : '',
|
||||
folder_id: store.getters.currentFolder.data.id ? store.getters.currentFolder.data.id : '',
|
||||
file: item,
|
||||
})
|
||||
});
|
||||
@@ -275,7 +275,7 @@ const FunctionHelpers = {
|
||||
}
|
||||
|
||||
// Detect windows
|
||||
Vue.prototype.$isWIndows = function () {
|
||||
Vue.prototype.$isWindows = function () {
|
||||
return navigator.userAgent.indexOf('Windows') != -1
|
||||
}
|
||||
|
||||
@@ -337,7 +337,7 @@ const FunctionHelpers = {
|
||||
}
|
||||
|
||||
Vue.prototype.$enableMultiSelectMode = function () {
|
||||
events.$emit('mobileSelecting:start')
|
||||
events.$emit('mobile-select:start')
|
||||
}
|
||||
|
||||
Vue.prototype.$showViewOptions = function () {
|
||||
|
||||
6
resources/js/helpers/itemHelpers.js
vendored
6
resources/js/helpers/itemHelpers.js
vendored
@@ -27,10 +27,10 @@ const itemHelpers = {
|
||||
Vue.prototype.$downloadSelection = function (item) {
|
||||
let clipboard = this.$store.getters.clipboard
|
||||
|
||||
if (clipboard.length > 1 || (clipboard.length === 1 && clipboard[0].type === 'folder'))
|
||||
if (clipboard.length > 1 || (clipboard.length === 1 && clipboard[0].data.type === 'folder'))
|
||||
this.$store.dispatch('downloadZip')
|
||||
else {
|
||||
Vue.prototype.$downloadFile(item.file_url, item.name + '.' + item.mimetype)
|
||||
Vue.prototype.$downloadFile(item.data.attributes.file_url, item.data.attributes.name + '.' + item.data.attributes.mimetype)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ const itemHelpers = {
|
||||
}
|
||||
|
||||
Vue.prototype.$shareFileOrFolder = function (entry) {
|
||||
let event = entry.shared
|
||||
let event = entry.data.relationships.shared
|
||||
? 'share-edit'
|
||||
: 'share-create'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user