mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-19 00:22:15 +00:00
add preview&Sorting menu for mobile version, refacoring sorting URI
This commit is contained in:
11
resources/js/store/modules/app.js
vendored
11
resources/js/store/modules/app.js
vendored
@@ -8,6 +8,10 @@ const defaultState = {
|
||||
authorized: undefined,
|
||||
homeDirectory: undefined,
|
||||
requestedPlan: undefined,
|
||||
sorting: {
|
||||
sort: localStorage.getItem('sorting') ? JSON.parse(localStorage.getItem('sorting')).sort : 'DESC',
|
||||
field: localStorage.getItem('sorting') ? JSON.parse(localStorage.getItem('sorting')).field : 'created_at',
|
||||
},
|
||||
roles: [
|
||||
{
|
||||
label: i18n.t('roles.admin'),
|
||||
@@ -861,6 +865,10 @@ const actions = {
|
||||
},
|
||||
}
|
||||
const mutations = {
|
||||
UPDATE_SORTING(state) {
|
||||
state.sorting.field = JSON.parse(localStorage.getItem('sorting')).field
|
||||
state.sorting.sort = JSON.parse(localStorage.getItem('sorting')).sort
|
||||
},
|
||||
INIT(state, data) {
|
||||
state.config = data.config
|
||||
state.authorized = data.authCookie
|
||||
@@ -902,6 +910,9 @@ const getters = {
|
||||
config: state => state.config,
|
||||
index: state => state.index,
|
||||
roles: state => state.roles,
|
||||
sorting: (state) => {
|
||||
return {sorting: state.sorting , URI: '?sort=' + state.sorting.field + '&direction=' + state.sorting.sort}
|
||||
},
|
||||
}
|
||||
|
||||
export default {
|
||||
|
||||
Reference in New Issue
Block a user