Add deselection by clicking on black space of tileview
This commit is contained in:
parent
93dcea8b21
commit
17dbd6249b
@ -59,6 +59,7 @@ body{
|
||||
|
||||
#desktop-layer{
|
||||
position: absolute;
|
||||
/* margin: 0px; */
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #9999CC;
|
||||
|
@ -1,7 +1,13 @@
|
||||
.FileTileView{
|
||||
width: 100%;
|
||||
height: auto;
|
||||
height: 100%;
|
||||
|
||||
/* FIXME Bug, on desktop mode top ~10 pixel are not active, like margin:10px */
|
||||
}
|
||||
|
||||
.FileTileView .FlexContainer{
|
||||
width: 100%;
|
||||
height: auto;
|
||||
/* Auto layout */
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
@ -18,7 +24,6 @@
|
||||
/* overflow-x: hidden; */
|
||||
scrollbar-width: none; /* Firefox */
|
||||
-ms-overflow-style: none; /* Internet Explorer 10+ */
|
||||
|
||||
}
|
||||
|
||||
.FileTileView::-webkit-scrollbar { /* WebKit */
|
||||
|
@ -10,14 +10,13 @@ class FileView{
|
||||
this.parentElem = fileViewElem
|
||||
|
||||
fileViewElem.addEventListener('click', (event) => {
|
||||
|
||||
console.log(event)
|
||||
if (event.target.classList[0] == 'FileTileView')
|
||||
{
|
||||
this.DeselectAll()
|
||||
return
|
||||
}
|
||||
if (event.detail === 1){
|
||||
this.selected.forEach(element => {
|
||||
// console.log
|
||||
element.classList.remove("Selected")
|
||||
});
|
||||
this.selected = []
|
||||
this.DeselectAll()
|
||||
this.selected.push(event.target)
|
||||
event.target.classList.add("Selected")
|
||||
} else if (event.detail === 2) {
|
||||
@ -26,6 +25,13 @@ class FileView{
|
||||
})
|
||||
}
|
||||
|
||||
DeselectAll(){
|
||||
this.selected.forEach(element => {
|
||||
element.classList.remove("Selected")
|
||||
});
|
||||
this.selected = []
|
||||
}
|
||||
|
||||
/** Get html of folder by path
|
||||
* @param {string} path
|
||||
*/
|
||||
|
@ -1,9 +1,11 @@
|
||||
{{ define "wde-widgets/file-tile-view.tmpl" }}
|
||||
<div class="FlexContainer NoClick">
|
||||
{{ range $fileTile := .Files }}
|
||||
<div fileType="{{ $fileTile.Type }}" class="Tile" name="{{$fileTile.Name}}">
|
||||
<div fileType="{{ $fileTile.Type }}" class="Tile Click" name="{{$fileTile.Name}}">
|
||||
<!-- <div class="Icon NoClick"></div> -->
|
||||
<img class="Icon NoClick" src="{{ $fileTile.Icon }}">
|
||||
<div class="Lable NoClick">{{ $fileTile.Name }}</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
Loading…
Reference in New Issue
Block a user