improved visual of storage tree

This commit is contained in:
dcore94 2023-10-25 18:59:36 +02:00
parent 6dff3cd55c
commit 2897f65a60
1 changed files with 15 additions and 7 deletions

View File

@ -536,18 +536,26 @@ class CCPRemoteFileInputWidgetController extends CCPBaseInputWidgetController{
<svg name="trigger" style="width:24;height:24;fill:#007bff; cursor:pointer" viewBox="0 -960 960 960">
<path d="M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h240l80 80h320q33 0 56.5 23.5T880-640H447l-80-80H160v480l96-320h684L837-217q-8 26-29.5 41.5T760-160H160Zm84-80h516l72-240H316l-72 240Zm0 0 72-240-72 240Zm-84-400v-80 80Z"/>
</svg>
<d4s-storage-tree
class="d-none position-absolute shadow border border-primary bg-light"
style="left: 100%; margin: 0 0 0 -.5rem;min-width:350px; max-width:500px;z-index:1000; line-height:1.5rem;overflow-x:hidden;text-wrap:nowrap;text-overflow: ellipsis;min-height:5rem; max-height:10rem; padding:5px;"
base-url="${this.baseurl}"
file-download-enabled="true"
show-files="true"
allow-drag="true"/>
<div class="position-absolute shadow border border-primary bg-light p-2" style="left: 100%;min-width:350px; max-width:500px;z-index:1000; line-height:1.5rem;overflow-x:hidden;text-wrap:nowrap;text-overflow: ellipsis;min-height:5rem; max-height:10rem; padding:5px;">
<div class="d-flex justify-content-between" style="border-bottom: solid 1px gray;">
<h5 class="text-secondary">Access your workspace</h5>
<span class="btn text-danger p-0" style="font-weight:bold" name="closebtn">x</span>
</div>
<d4s-storage-tree
base-url="${this.baseurl}"
file-download-enabled="true"
show-files="true"
allow-drag="true"/>
</div>
`
const ws = this.rootdoc.querySelector("d4s-storage-tree")
this.rootdoc.querySelector("svg[name=trigger]").addEventListener("click", ev=>{
ws.classList.toggle("d-none")
})
this.rootdoc.querySelector("svg[name=closebtn]").addEventListener("click", ev=>{
ws.classList.remove("d-none")
})
this.addEventListener("dragover", ev=>{
ev.preventDefault()