Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable28] fix(files): Adjust table header to look like on previous versions #41976

Merged
merged 2 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions apps/files/src/components/FilesListTableHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-
- @author John Molakvoæ <skjnldsv@protonmail.com>
-
- @license GNU AGPL version 3 or any later version
- @license AGPL-3.0-or-later
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
Expand Down Expand Up @@ -34,8 +34,7 @@
<template v-else>
<!-- Link to file -->
<th class="files-list__column files-list__row-name files-list__column--sortable"
:aria-sort="ariaSortForMode('basename')"
@click.stop.prevent="toggleSortBy('basename')">
:aria-sort="ariaSortForMode('basename')">
<!-- Icon or preview -->
<span class="files-list__row-icon" />

Expand Down
49 changes: 26 additions & 23 deletions apps/files/src/components/FilesListTableHeaderButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
- @copyright Copyright (c) 2023 John Molakvoæ <skjnldsv@protonmail.com>
-
- @author John Molakvoæ <skjnldsv@protonmail.com>
- @author Ferdinand Thiessen <opensource@fthiessen.de>
-
- @license GNU AGPL version 3 or any later version
- @license AGPL-3.0-or-later
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
Expand All @@ -26,11 +27,12 @@
}]"
:alignment="mode === 'size' ? 'end' : 'start-reverse'"
type="tertiary"
@click.stop.prevent="toggleSortBy(mode)">
<!-- Sort icon before text as size is align right -->
<MenuUp v-if="sortingMode !== mode || isAscSorting" slot="icon" />
<MenuDown v-else slot="icon" />
{{ name }}
@click="toggleSortBy(mode)">
<template #icon>
<MenuUp v-if="sortingMode !== mode || isAscSorting" class="files-list__column-sort-button-icon" />
<MenuDown v-else class="files-list__column-sort-button-icon" />
</template>
<span class="files-list__column-sort-button-text">{{ name }}</span>
</NcButton>
</template>

Expand Down Expand Up @@ -74,32 +76,33 @@ export default defineComponent({
})
</script>

<style lang="scss">
<style scoped lang="scss">
.files-list__column-sort-button {
// Compensate for cells margin
margin: 0 calc(var(--cell-margin) * -1);
min-width: calc(100% - 3 * var(--cell-margin))!important;

.button-vue__icon {
transition-timing-function: linear;
transition-duration: .1s;
transition-property: opacity;
&-text {
color: var(--color-text-maxcontrast);
font-weight: normal;
}

&-icon {
color: var(--color-text-maxcontrast);
opacity: 0;
transition: opacity var(--animation-quick);
inset-inline-start: -10px;
}

// Remove when https://github.com/nextcloud/nextcloud-vue/pull/3936 is merged
.button-vue__text {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
&--size &-icon {
inset-inline-start: 10px;
}

&--active,
&:hover,
&:focus,
&:active {
.button-vue__icon {
opacity: 1 !important;
}
&--active &-icon,
&:hover &-icon,
&:focus &-icon,
&:active &-icon {
opacity: 1;
}
}
</style>
4 changes: 2 additions & 2 deletions dist/files-main.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

Loading