vue frontend update

This commit is contained in:
carodej
2020-04-20 09:01:54 +02:00
parent 506c39896a
commit 8740cc7685
21 changed files with 416 additions and 237 deletions
+14 -1
View File
@@ -1,5 +1,5 @@
import store from './store/index'
import {debounce} from "lodash";
import {debounce, includes} from "lodash";
import {events} from './bus'
import axios from 'axios'
@@ -221,6 +221,19 @@ const Helpers = {
return store.getters.currentFolder && store.getters.currentFolder.location === 'base' ? true : false
}
Vue.prototype.$checkPermission = function(type) {
let currentPermission = store.getters.permission
// Check if type is object
if (typeof type === 'Object' || type instanceof Object) {
return includes(type, currentPermission)
} else {
return currentPermission === type
}
}
Vue.prototype.$isMobile = function() {
const toMatch = [
/Android/i,