feat: add button to navigate up to .. (parent dir)
This commit is contained in:
parent
05bfae264a
commit
655a309a96
@ -32,6 +32,7 @@
|
||||
"selectMultiple": "Select multiple",
|
||||
"share": "Share",
|
||||
"shell": "Toggle shell",
|
||||
"gotoParent": "Open parent dir",
|
||||
"submit": "Submit",
|
||||
"switchView": "Switch view",
|
||||
"toggleSidebar": "Toggle sidebar",
|
||||
|
||||
@ -46,7 +46,12 @@
|
||||
show="delete"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<action
|
||||
v-if="headerButtons.gotoParent"
|
||||
icon="arrow_upward"
|
||||
:label="$t('buttons.gotoParent')"
|
||||
@action="gotoParent"
|
||||
/>
|
||||
<action
|
||||
v-if="headerButtons.shell"
|
||||
icon="code"
|
||||
@ -367,6 +372,7 @@ export default {
|
||||
},
|
||||
headerButtons() {
|
||||
return {
|
||||
gotoParent: true,
|
||||
upload: this.user.perm.create,
|
||||
download: this.user.perm.download,
|
||||
shell: this.user.perm.execute && enableExec,
|
||||
@ -853,6 +859,14 @@ export default {
|
||||
this.setItemWeight();
|
||||
this.fillWindow();
|
||||
},
|
||||
|
||||
gotoParent: function() {
|
||||
const url = (window.location.pathname || "")
|
||||
const parts = url.replace(/\/$/, '').split('/');
|
||||
parts.pop();
|
||||
const parentUrl = parts.join('/');
|
||||
this.$router.push({ path: parentUrl });
|
||||
},
|
||||
upload: function () {
|
||||
if (
|
||||
typeof window.DataTransferItem !== "undefined" &&
|
||||
|
||||
Loading…
Reference in New Issue
Block a user