mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-19 18:13:41 -05:00
web/jsonview: fix extra newlines when copying json
This commit is contained in:
parent
219f92c222
commit
8ca664c745
3 changed files with 12 additions and 5 deletions
|
@ -153,7 +153,7 @@ input, textarea {
|
|||
font-size: 1em;
|
||||
}
|
||||
|
||||
button, a.button {
|
||||
button, a.button, span.button {
|
||||
cursor: var(--clickable-cursor);
|
||||
font-size: 1em;
|
||||
background: none;
|
||||
|
|
|
@ -15,9 +15,13 @@ pre.json-view {
|
|||
user-select: none;
|
||||
}
|
||||
|
||||
button {
|
||||
span.button {
|
||||
padding: 0 .25rem;
|
||||
display: inline-flex;
|
||||
|
||||
&::before {
|
||||
content: attr(data-symbol);
|
||||
}
|
||||
}
|
||||
|
||||
/* If the screen is wide enough, make line-wrapped strings aligned after the object key */
|
||||
|
|
|
@ -82,9 +82,12 @@ function JSONValueWithKey({ data, objectKey, trailingComma, noCollapse }: JSONVi
|
|||
? <span className="json-object-comma p">,</span>
|
||||
: null
|
||||
const collapseButton = noCollapse ? null :
|
||||
<button onClick={toggleCollapsed} title={collapsed ? "Expand" : "Collapse"}>
|
||||
{collapsed ? "+" : "-"}
|
||||
</button>
|
||||
<span
|
||||
className="button"
|
||||
data-symbol={collapsed ? "+" : "-"}
|
||||
onClick={toggleCollapsed}
|
||||
title={collapsed ? "Expand" : "Collapse"}
|
||||
/>
|
||||
if (Array.isArray(data)) {
|
||||
return <>
|
||||
{renderedKey}
|
||||
|
|
Loading…
Add table
Reference in a new issue