mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 23:29:02 +02:00
feat(views/table): improve column context menu
This commit is contained in:
parent
7acd300163
commit
08e08d8920
@ -21,20 +21,10 @@ function showColumnContextMenu(_e: UIEvent, column: ColumnComponent, tabulator:
|
|||||||
|
|
||||||
contextMenu.show({
|
contextMenu.show({
|
||||||
items: [
|
items: [
|
||||||
{
|
|
||||||
title: `Hide column ${title}`,
|
|
||||||
handler: () => column.hide()
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Show/hide columns",
|
|
||||||
items: buildColumnItems()
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "----"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: `Sort by ${title}`,
|
title: `Sort by ${title}`,
|
||||||
enabled: !!field,
|
enabled: !!field,
|
||||||
|
uiIcon: "bx bx-sort-alt-2",
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
title: "Ascending",
|
title: "Ascending",
|
||||||
@ -63,8 +53,22 @@ function showColumnContextMenu(_e: UIEvent, column: ColumnComponent, tabulator:
|
|||||||
{
|
{
|
||||||
title: "Clear sorting",
|
title: "Clear sorting",
|
||||||
enabled: sorters.length > 0,
|
enabled: sorters.length > 0,
|
||||||
|
uiIcon: "bx bx-empty",
|
||||||
handler: () => tabulator.clearSort()
|
handler: () => tabulator.clearSort()
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
title: "----"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: `Hide column ${title}`,
|
||||||
|
uiIcon: "bx bx-hide",
|
||||||
|
handler: () => column.hide()
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Show/hide columns",
|
||||||
|
uiIcon: "bx bx-empty",
|
||||||
|
items: buildColumnItems()
|
||||||
|
},
|
||||||
],
|
],
|
||||||
selectMenuItemHandler() {},
|
selectMenuItemHandler() {},
|
||||||
x: e.pageX,
|
x: e.pageX,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user