Skip to content

Commit cf4f048

Browse files
authored
Merge pull request #8079 from nextcloud/fix/table_buttons_small
fix(table): use small buttons for table actions
2 parents 143ee59 + 7f2f8fa commit cf4f048

6 files changed

Lines changed: 17 additions & 12 deletions

File tree

-451 Bytes
Loading
-451 Bytes
Loading

src/css/prosemirror.scss

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,12 +341,11 @@ div.ProseMirror {
341341

342342
table {
343343
border-spacing: 0;
344-
width: calc(100% - 50px - var(--default-clickable-area));
344+
// Needs to be sync with `.table-add-row` button width in `TableView.vue`
345+
width: calc(100% - (2 * var(--clickable-area-small)) - 8px);
345346
table-layout: auto;
346347
white-space: normal; // force text to wrapping
347-
margin-bottom: calc(
348-
var(--clickable-area-small) + var(--default-clickable-area)
349-
);
348+
margin-bottom: calc(var(--clickable-area-small) + 8px);
350349
& + * {
351350
margin-top: 1em;
352351
}

src/nodes/Table/TableCellView.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<NodeViewWrapper data-text-el="table-cell" as="td" :dir="dir" :style="textAlign">
88
<div class="container">
99
<NodeViewContent class="content" />
10-
<NcActions v-if="isEditable" data-text-table-actions="row">
10+
<NcActions v-if="isEditable" data-text-table-actions="row" size="small">
1111
<NcActionButton
1212
data-text-table-action="add-row-before"
1313
close-after-click
@@ -141,10 +141,10 @@ td {
141141
142142
.action-item {
143143
position: absolute;
144-
right: -48px;
144+
right: calc((var(--clickable-area-small) * -1) - 4px);
145145
flex: 0 1 auto;
146146
display: none;
147-
top: 2px;
147+
top: calc((var(--default-clickable-area) - var(--clickable-area-small)) / 2);
148148
}
149149
150150
&:last-child {

src/nodes/Table/TableHeaderView.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<NcActions
1515
v-if="isEditable"
1616
ref="menu"
17+
size="small"
1718
variant="tertiary-no-background"
1819
data-text-table-actions="header">
1920
<NcActionButtonGroup>
@@ -214,6 +215,7 @@ th {
214215
}
215216
216217
.action-item {
218+
top: calc((var(--default-clickable-area) - var(--clickable-area-small)) / 2);
217219
opacity: 50%;
218220
}
219221

src/nodes/Table/TableView.vue

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<NcActions
1212
v-if="isEditable"
1313
force-menu
14+
size="small"
1415
data-text-table-actions="settings"
1516
class="table-settings">
1617
<template #icon>
@@ -30,6 +31,7 @@
3031
<NcButton
3132
v-if="isEditable"
3233
class="table-add-column"
34+
size="small"
3335
:aria-label="t('text', 'Add column after')"
3436
:title="t('text', 'Add column after')"
3537
@click="addColumnAfter">
@@ -40,6 +42,7 @@
4042
<NcButton
4143
v-if="isEditable"
4244
class="table-add-row"
45+
size="small"
4346
:aria-label="t('text', 'Add row below')"
4447
:title="t('text', 'Add row below')"
4548
@click="addRowAfter">
@@ -154,8 +157,8 @@ export default {
154157
padding-left: 3px;
155158
opacity: 0.5;
156159
position: absolute;
157-
top: 0;
158-
right: var(--default-clickable-area);
160+
top: calc((var(--default-clickable-area) - var(--clickable-area-small)) / 2);
161+
right: calc(var(--clickable-area-small) + 4px);
159162
160163
&:hover {
161164
opacity: 1;
@@ -169,7 +172,7 @@ export default {
169172
position: absolute;
170173
top: var(--default-clickable-area);
171174
right: 0;
172-
bottom: 60px;
175+
bottom: calc(var(--clickable-area-small) + 8px);
173176
margin-top: 0 !important;
174177
175178
&:hover {
@@ -183,8 +186,9 @@ export default {
183186
opacity: 0.5;
184187
position: absolute;
185188
left: 0;
186-
bottom: 12px;
187-
width: calc(100% - 80px) !important;
189+
bottom: 4px;
190+
// Needs to be in sync with table width in `prosemirror.css`
191+
width: calc(100% - (2 * var(--clickable-area-small)) - 8px) !important;
188192
189193
&:hover {
190194
opacity: 1;

0 commit comments

Comments
 (0)