Skip to content

Commit

Permalink
Merge pull request #1868 from nextcloud/artonge/backport/stable27/1867
Browse files Browse the repository at this point in the history
[stable27] Make file list semantically correct
  • Loading branch information
artonge authored Jun 13, 2023
2 parents 572944b + 2e1b510 commit d9f946e
Show file tree
Hide file tree
Showing 19 changed files with 42 additions and 36 deletions.
4 changes: 2 additions & 2 deletions js/photos-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-main.js.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/photos-public.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-public.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/photos-src_components_Collection_CollectionContent_vue.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/photos-src_views_AlbumContent_vue.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-src_views_AlbumContent_vue.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/photos-src_views_Timeline_vue.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-src_views_Timeline_vue.js.map

Large diffs are not rendered by default.

24 changes: 15 additions & 9 deletions src/components/FilesListViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,21 @@
:scroll-to-key="scrollToSection"
@need-content="needContent">
<ul slot-scope="{renderedRows}">
<div v-for="row of renderedRows"
:key="row.key"
class="tiled-row"
:class="{'files-list-viewer__section-header': row.items[0].sectionHeader}"
:style="{height: `${row.height}px`}">
<template v-for="row of renderedRows">
<!--
We are subtracting 1 from flex-basis to compensate for rounding issues.
The flex algo will then compensate with flex-grow.
-->
<li v-for="item of row.items"
:key="item.id"
:style="{ width: item.ratio ? `${row.height * item.ratio}px` : '100%', height: `${row.height}px`}">
:class="{'files-list-viewer__section-header': item.sectionHeader}"
:style="{ 'flex-basis': item.ratio ? `${row.height * item.ratio - 1}px` : '100%', height: `${row.height}px`}">
<!-- Placeholder when initial loading -->
<div v-if="showPlaceholders" class="files-list-viewer__placeholder" />
<!-- Real file. -->
<slot v-else :file="item" :distance="row.distance" />
</li>
</div>
</template>
</ul>
<NcLoadingIcon v-if="loading && !showPlaceholders" slot="loader" class="files-list-viewer__loader" />
</VirtualScrolling>
Expand Down Expand Up @@ -279,9 +280,14 @@ export default {
.tiled-container {
flex-basis: 0;
}
ul {
display: flex;
flex-wrap: wrap;
.tiled-row {
display: flex;
li {
flex-grow: 1;
}
}
Expand Down

0 comments on commit d9f946e

Please sign in to comment.