mirror of
https://github.com/zadam/trilium.git
synced 2025-11-28 19:44:24 +01:00
fix(ribbon): tooltip for expand button
This commit is contained in:
parent
c65b03db41
commit
dc572c3815
@ -764,7 +764,7 @@
|
||||
"grid": "Grid",
|
||||
"list": "List",
|
||||
"collapse_all_notes": "Collapse all notes",
|
||||
"expand_all_children": "Expand all children",
|
||||
"expand_tooltip": "Expands the direct children of this collection (one level deep). For more options, press the arrow on the right.",
|
||||
"collapse": "Collapse",
|
||||
"expand": "Expand",
|
||||
"expand_first_level": "Expand direct children",
|
||||
|
||||
@ -81,9 +81,10 @@ export function ButtonGroup({ children }: { children: ComponentChildren }) {
|
||||
)
|
||||
}
|
||||
|
||||
export function SplitButton({ text, icon, children, onClick }: {
|
||||
export function SplitButton({ text, icon, children, ...restProps }: {
|
||||
text: string;
|
||||
icon?: string;
|
||||
title?: string;
|
||||
/** Click handler for the main button component (not the split). */
|
||||
onClick?: () => void;
|
||||
/** The children inside the dropdown of the split. */
|
||||
@ -91,7 +92,7 @@ export function SplitButton({ text, icon, children, onClick }: {
|
||||
}) {
|
||||
return (
|
||||
<ButtonGroup>
|
||||
<button type="button" class="btn btn-secondary" onClick={onClick}>
|
||||
<button type="button" class="btn btn-secondary" {...restProps}>
|
||||
{icon && <Icon icon={`bx ${icon}`} />}
|
||||
{text}
|
||||
</button>
|
||||
|
||||
@ -120,6 +120,7 @@ function SplitButtonPropertyView({ note, property }: { note: FNote, property: Sp
|
||||
return <SplitButton
|
||||
text={property.label}
|
||||
icon={property.icon}
|
||||
title={property.title}
|
||||
onClick={() => clickContext && property.onClick(clickContext)}
|
||||
>
|
||||
{parentComponent && <ItemsComponent note={note} parentComponent={parentComponent} />}
|
||||
|
||||
@ -95,7 +95,7 @@ export const bookPropertiesConfig: Record<ViewTypeOptions, BookConfig> = {
|
||||
},
|
||||
{
|
||||
label: t("book_properties.expand"),
|
||||
title: t("book_properties.expand_all_children"),
|
||||
title: t("book_properties.expand_tooltip"),
|
||||
type: "split-button",
|
||||
icon: "bx bx-move-vertical",
|
||||
onClick: buildExpandListHandler(1),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user