feat: remain in the same position when back from a subfolder
This commit is contained in:
parent
05bfae264a
commit
5f64bc711a
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<header-bar v-if="error || req.type == null" showMenu showLogo />
|
<header-bar v-if="error || req.type == undefined" showMenu showLogo />
|
||||||
|
|
||||||
<breadcrumbs base="/files" />
|
<breadcrumbs base="/files" />
|
||||||
<listing />
|
<listing />
|
||||||
@ -47,6 +47,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
error: null,
|
error: null,
|
||||||
width: window.innerWidth,
|
width: window.innerWidth,
|
||||||
|
parentDir: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -69,25 +70,27 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
$route: function (to, from) {
|
$route: function (to, from) {
|
||||||
if (from.path.endsWith("/")) {
|
if (
|
||||||
if (to.path.endsWith("/")) {
|
to.path.endsWith("/") &&
|
||||||
|
from.path.startsWith(to.path) &&
|
||||||
|
from.path.length > to.path.length
|
||||||
|
) {
|
||||||
|
this.parentDir = "true";
|
||||||
|
} else {
|
||||||
|
this.parentDir = "false";
|
||||||
|
window.sessionStorage.removeItem(to.path);
|
||||||
|
}
|
||||||
|
if (from.path.endsWith("/")) {
|
||||||
|
if (to.path.endsWith("/")) {
|
||||||
window.sessionStorage.setItem("listFrozen", "false");
|
window.sessionStorage.setItem("listFrozen", "false");
|
||||||
this.fetchData();
|
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
window.sessionStorage.setItem("listFrozen", "true");
|
window.sessionStorage.setItem("listFrozen", "true");
|
||||||
this.fetchData();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
} else if (to.path.endsWith("/")) {
|
} else if (to.path.endsWith("/")) {
|
||||||
this.$store.commit("updateRequest", {});
|
this.$store.commit("updateRequest", {});
|
||||||
this.fetchData();
|
}
|
||||||
return;
|
this.fetchData();
|
||||||
} else {
|
},
|
||||||
this.fetchData();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
reload: function (value) {
|
reload: function (value) {
|
||||||
if (value === true) {
|
if (value === true) {
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
@ -116,7 +119,11 @@ export default {
|
|||||||
this.$store.commit("closeHovers");
|
this.$store.commit("closeHovers");
|
||||||
|
|
||||||
// Set loading to true and reset the error.
|
// Set loading to true and reset the error.
|
||||||
if (window.sessionStorage.getItem("listFrozen") !=="true" && window.sessionStorage.getItem("modified") !=="true"){
|
if (
|
||||||
|
window.sessionStorage.getItem("listFrozen") !== "true" &&
|
||||||
|
window.sessionStorage.getItem("modified") !== "true" &&
|
||||||
|
this.parentDir !== "true"
|
||||||
|
) {
|
||||||
this.setLoading(true);
|
this.setLoading(true);
|
||||||
}
|
}
|
||||||
this.error = null;
|
this.error = null;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user