mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-05-08 11:22:10 +00:00
feat: freezing the list in the backgroud while previewing a file (#3004)
This commit is contained in:
parent
fe5ca74aa1
commit
e167c3e1ef
@ -152,7 +152,7 @@ main .spinner .bounce2 {
|
|||||||
/* PREVIEWER */
|
/* PREVIEWER */
|
||||||
|
|
||||||
#previewer {
|
#previewer {
|
||||||
background-color: rgba(0, 0, 0, 0.9);
|
background-color: rgba(0, 0, 0, 0.99);
|
||||||
padding-top: 4em;
|
padding-top: 4em;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
<header-bar v-if="error || req.type == null" showMenu showLogo />
|
<header-bar v-if="error || req.type == null" showMenu showLogo />
|
||||||
|
|
||||||
<breadcrumbs base="/files" />
|
<breadcrumbs base="/files" />
|
||||||
|
<listing />
|
||||||
<errors v-if="error" :errorCode="error.status" />
|
<errors v-if="error" :errorCode="error.status" />
|
||||||
<component v-else-if="currentView" :is="currentView"></component>
|
<component v-else-if="currentView" :is="currentView"></component>
|
||||||
<div v-else>
|
<div v-else-if="currentView !== null">
|
||||||
<h2 class="message delayed">
|
<h2 class="message delayed">
|
||||||
<div class="spinner">
|
<div class="spinner">
|
||||||
<div class="bounce1"></div>
|
<div class="bounce1"></div>
|
||||||
@ -52,13 +52,10 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
...mapState(["req", "reload", "loading"]),
|
...mapState(["req", "reload", "loading"]),
|
||||||
currentView() {
|
currentView() {
|
||||||
if (this.req.type == undefined) {
|
if (this.req.type == undefined || this.req.isDir) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
else if (
|
||||||
if (this.req.isDir) {
|
|
||||||
return "listing";
|
|
||||||
} else if (
|
|
||||||
this.req.type === "text" ||
|
this.req.type === "text" ||
|
||||||
this.req.type === "textImmutable"
|
this.req.type === "textImmutable"
|
||||||
) {
|
) {
|
||||||
@ -72,7 +69,26 @@ export default {
|
|||||||
this.fetchData();
|
this.fetchData();
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
$route: "fetchData",
|
$route: function (to, from) {
|
||||||
|
if (from.path.endsWith("/")) {
|
||||||
|
if (to.path.endsWith("/")) {
|
||||||
|
window.sessionStorage.setItem('listFrozen', "false");
|
||||||
|
this.fetchData();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
window.sessionStorage.setItem('listFrozen', "true");
|
||||||
|
this.fetchData();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else if (to.path.endsWith("/")) {
|
||||||
|
this.$store.commit("updateRequest", {});
|
||||||
|
this.fetchData();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
this.fetchData();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
},
|
||||||
reload: function (value) {
|
reload: function (value) {
|
||||||
if (value === true) {
|
if (value === true) {
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
@ -101,7 +117,9 @@ 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"){
|
||||||
this.setLoading(true);
|
this.setLoading(true);
|
||||||
|
}
|
||||||
this.error = null;
|
this.error = null;
|
||||||
|
|
||||||
let url = this.$route.path;
|
let url = this.$route.path;
|
||||||
|
@ -383,6 +383,7 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
req: function () {
|
req: function () {
|
||||||
|
if (window.sessionStorage.getItem('listFrozen') !=="true"){
|
||||||
// Reset the show value
|
// Reset the show value
|
||||||
this.showLimit = 50;
|
this.showLimit = 50;
|
||||||
|
|
||||||
@ -394,6 +395,10 @@ export default {
|
|||||||
// Fill and fit the window with listing items
|
// Fill and fit the window with listing items
|
||||||
this.fillWindow(true);
|
this.fillWindow(true);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
if (this.req.isDir) {
|
||||||
|
window.sessionStorage.setItem('listFrozen', "false");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
id="previewer"
|
id="previewer"
|
||||||
|
@touchmove.prevent.stop
|
||||||
|
@wheel.prevent.stop
|
||||||
@mousemove="toggleNavigation"
|
@mousemove="toggleNavigation"
|
||||||
@touchstart="toggleNavigation"
|
@touchstart="toggleNavigation"
|
||||||
>
|
>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user