diff --git a/frontend/src/views/files/Editor.vue b/frontend/src/views/files/Editor.vue index f4871615..31c55e49 100644 --- a/frontend/src/views/files/Editor.vue +++ b/frontend/src/views/files/Editor.vue @@ -28,7 +28,6 @@ import { mapState } from "vuex"; import { files as api } from "@/api"; import { theme } from "@/utils/constants"; import buttons from "@/utils/buttons"; -import url from "@/utils/url"; import { version as ace_version } from "ace-builds"; import ace from "ace-builds/src-min-noconflict/ace.js"; @@ -148,8 +147,7 @@ export default { this.$store.commit("updateRequest", {}); - let uri = url.removeLastDir(this.$route.path) + "/"; - this.$router.push({ path: uri }); + history.back(); }, }, }; diff --git a/frontend/src/views/files/Listing.vue b/frontend/src/views/files/Listing.vue index aad09333..369634fc 100644 --- a/frontend/src/views/files/Listing.vue +++ b/frontend/src/views/files/Listing.vue @@ -385,7 +385,7 @@ export default { req: function () { if (window.sessionStorage.getItem("listFrozen") !=="true" && window.sessionStorage.getItem("modified") !=="true"){ // Reset the show value - this.showLimit = 50; + this.showLimit = this.req.numDirs + this.req.numFiles; // Ensures that the listing is displayed Vue.nextTick(() => { @@ -394,6 +394,11 @@ export default { // Fill and fit the window with listing items this.fillWindow(true); + if (window.sessionStorage.getItem(this.$route.path)) { + this.addSelected(JSON.parse(window.sessionStorage.getItem(this.$route.path))[1]); + document.documentElement.scrollTop = JSON.parse(window.sessionStorage.getItem(this.$route.path))[0]; + window.sessionStorage.removeItem(this.$route.path); + } }); } if (this.req.isDir) { @@ -882,9 +887,9 @@ export default { const windowHeight = window.innerHeight; // Quantity of items needed to fill 2x of the window height - const showQuantity = Math.ceil( - (windowHeight + windowHeight * 2) / this.itemWeight - ); + const showQuantity = window.sessionStorage.getItem(this.$route.path) ? + Math.ceil((JSON.parse(window.sessionStorage.getItem(this.$route.path))[0] + windowHeight * 2) / this.itemWeight) : + Math.ceil((windowHeight + windowHeight * 2) / this.itemWeight); // Less items to display than current if (this.showLimit > showQuantity && !fit) return; diff --git a/frontend/src/views/files/Preview.vue b/frontend/src/views/files/Preview.vue index c6b0dbe0..503d1855 100644 --- a/frontend/src/views/files/Preview.vue +++ b/frontend/src/views/files/Preview.vue @@ -346,8 +346,7 @@ export default { close() { this.$store.commit("updateRequest", {}); - let uri = url.removeLastDir(this.$route.path) + "/"; - this.$router.push({ path: uri }); + history.back(); }, download() { window.open(this.downloadUrl);