edit: remplacement du bouton menu par retour (remonter de 1 element dans l'arboresence) dans link pannel
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import FolderIcon from '../assets/icons/folder.svg'
|
||||
import FileIcon from '../assets/icons/file.svg'
|
||||
import ReloadIcon from '../assets/icons/reload.svg'
|
||||
import BackIcon from '../assets/icons/back.svg'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -18,8 +19,8 @@
|
||||
<div class="titleContent">
|
||||
<p>./{{fileName}}</p>
|
||||
<div class="multiBtnContainer">
|
||||
<button type="button" class="titleBtn" id="rootBtn" v-show="isNotRoot" @mousedown.stop @touchstart="dataFirstLoad" @click="dataFirstLoad">
|
||||
<ReloadIcon name="close" class="icon"/>
|
||||
<button type="button" class="titleBtn" id="rootBtn" v-show="isNotRoot" @mousedown.stop @touchstart="backToRoot" @click="backToRoot">
|
||||
<BackIcon name="backwoods" class="icon"/>
|
||||
</button>
|
||||
<button type="button" class="titleBtn" @mousedown.stop @touchstart="$emit('close')" @click="closeClicked">
|
||||
<CloseIcon name="close" class="icon"/>
|
||||
@@ -299,6 +300,7 @@
|
||||
openFile(e){
|
||||
this.$emit('focus');
|
||||
if(e.type === 'folder'){
|
||||
this.rootFolderContent.push({content:[...this.displayedItems], directory:this.fileName});
|
||||
this.displayedItems = [...e.children];
|
||||
this.checkEmptyFolder();
|
||||
this.isNotRoot = true;
|
||||
@@ -345,6 +347,17 @@
|
||||
this.emptyFolder = false;
|
||||
}
|
||||
},
|
||||
backToRoot(){
|
||||
let rootDepth = this.rootFolderContent.length-1;
|
||||
this.displayedItems = this.rootFolderContent[rootDepth].content;
|
||||
this.fileName = this.rootFolderContent[rootDepth].directory;
|
||||
this.rootFolderContent.splice(rootDepth,1);
|
||||
rootDepth = this.rootFolderContent.length
|
||||
if (rootDepth === 0){
|
||||
this.isNotRoot = false;
|
||||
}
|
||||
this.checkEmptyFolder();
|
||||
},
|
||||
closeClicked(){
|
||||
this.dataFirstLoad();
|
||||
this.$emit('close');
|
||||
@@ -359,6 +372,7 @@
|
||||
coordX:0,
|
||||
coordY:0,
|
||||
displayedItems: null,
|
||||
rootFolderContent: [],
|
||||
emptyFolder: false,
|
||||
displayedDescription: "",
|
||||
fileName: "",
|
||||
|
||||
Reference in New Issue
Block a user