mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-05-09 03:32:56 +00:00

Former-commit-id: 419fb04f20d9be50358b0d87285fa92855906f97 [formerly fd974c12d0c06b0bde92e201f636c977a1638608] [formerly faa13a4e0c06720f217e7e4387ca0bf9e367365d [formerly 39f39cca2951018d900ff777b36a9b8f720c4356]] Former-commit-id: b2df427ca1f97e407a549848649bad020eb5453f [formerly 484d32224ca56fa68d6b5b0f01626d69eaa0528b] Former-commit-id: 81103561b811e456c4e50dd0d8a6e555e8584839
32 lines
688 B
Vue
32 lines
688 B
Vue
<template>
|
|
<button @click="change" aria-label="Switch View" title="Switch View" class="action">
|
|
<i class="material-icons">{{ icon() }}</i>
|
|
<span>Switch view</span>
|
|
</button>
|
|
</template>
|
|
|
|
<script>
|
|
import page from '../page'
|
|
|
|
export default {
|
|
name: 'switch-button',
|
|
methods: {
|
|
change: function (event) {
|
|
let url = window.location.pathname + '?display='
|
|
|
|
if (this.$store.state.req.data.display === 'mosaic') {
|
|
url += 'list'
|
|
} else {
|
|
url += 'mosaic'
|
|
}
|
|
|
|
page.open(url)
|
|
},
|
|
icon: function () {
|
|
if (this.$store.state.req.data.display === 'mosaic') return 'view_list'
|
|
return 'view_module'
|
|
}
|
|
}
|
|
}
|
|
</script>
|