Filepicker grid

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2018-10-23 10:04:03 +02:00
parent bf6a1650ce
commit c039bd2bd1
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF
2 changed files with 48 additions and 2 deletions

View File

@ -697,7 +697,6 @@ code {
}
/* ---- DIALOGS ---- */
#oc-dialog-filepicker-content {
.dirtree {
width: 96%;
@ -771,9 +770,54 @@ code {
.filesize {
text-align: right;
}
&.view-grid {
$grid-size: 120px;
$grid-pad: 10px;
$name-height: 20px;
display: flex;
flex-direction: column;
tbody {
display: grid;
grid-template-columns: repeat(auto-fill, $grid-size);
justify-content: space-around;
row-gap: 15px;
margin: 15px 0;
tr {
display: block;
position: relative;
border-radius: var(--border-radius);
padding: $grid-pad;
display: flex;
flex-direction: column;
width: $grid-size - 2 * $grid-pad;
td {
border: none;
padding: 0;
&.filename {
padding: #{$grid-size - 2 * $grid-pad} 0 0 0;
background-position: center top;
background-size: contain;
line-height: $name-height;
height: $name-height;
}
&.filesize {
line-height: $name-height;
text-align: left;
}
&.date {
display: none;
}
}
}
}
}
}
.filepicker_element_selected {
background-color: lightblue;
background-color: var(--color-background-darker);
}
}

View File

@ -899,6 +899,8 @@ var OCdialogs = {
if (entry.type === 'file') {
var urlSpec = {
file: dir + '/' + entry.name,
x: 100,
y: 100
};
var img = new Image();
var previewUrl = OC.generateUrl('/core/preview.png?') + $.param(urlSpec);