filebrowser-fork/_assets/src/components/SwitchViewButton.vue
Henrique Dias a7b50c2de1 Updates on front end :D
Former-commit-id: 032b13b1f3a6216ae6bafde75f583038916b4f74 [formerly 80588a95ad5168ecab65e3d8cc8968bad9a20a6b] [formerly 94b306854bac60361ddf1b945a3edec7204d1327 [formerly 193adea6bb8a5cdc0d4e072b2c59fc0e82f69548]]
Former-commit-id: 67b5219c1a6488c1a797bec42a0dec2036441a48 [formerly 28183c674806c3125a285a48905a01e1e835be7e]
Former-commit-id: d2169aab351eab252ea34e07bb943411aa8e9cb4
2017-06-29 09:11:46 +01:00

34 lines
677 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'
var $ = window.info
export default {
name: 'switch-button',
methods: {
change: function (event) {
let url = window.location.pathname + '?display='
if ($.req.data.display === 'mosaic') {
url += 'list'
} else {
url += 'mosaic'
}
page.open(url)
},
icon: function () {
if ($.req.data.display === 'mosaic') return 'view_list'
return 'view_module'
}
}
}
</script>