aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/StyleProvider.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-04-01 10:34:09 -0400
committerbobzel <zzzman@gmail.com>2022-04-01 10:34:09 -0400
commit19366220aabeeb6fcdac6fa056b9b0e9585e8e6b (patch)
treec1ec26a515c77725f628c92b601647bca8946e8e /src/client/views/StyleProvider.tsx
parentd5d472521229f006f4a95d5c019276ec0281ac57 (diff)
fixed up document focus to take a collectkon so that the treeView can focus on the matching alias when multiple aliases are shown in different collections.
Diffstat (limited to 'src/client/views/StyleProvider.tsx')
-rw-r--r--src/client/views/StyleProvider.tsx8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/client/views/StyleProvider.tsx b/src/client/views/StyleProvider.tsx
index 2782574c5..649ee8394 100644
--- a/src/client/views/StyleProvider.tsx
+++ b/src/client/views/StyleProvider.tsx
@@ -10,6 +10,7 @@ import { BoolCast, Cast, NumCast, StrCast } from "../../fields/Types";
import { DashColor, lightOrDark } from '../../Utils';
import { DocumentType } from '../documents/DocumentTypes';
import { CurrentUserUtils } from '../util/CurrentUserUtils';
+import { DocFocusOrOpen } from '../util/DocumentManager';
import { ColorScheme } from '../util/SettingsManager';
import { SnappingManager } from '../util/SnappingManager';
import { undoBatch, UndoManager } from '../util/UndoManager';
@@ -212,7 +213,12 @@ export function DashboardStyleProvider(doc: Opt<Doc>, props: Opt<FieldViewProps
if (doc && property.split(":")[0] === StyleProp.Decorations) {
return doc._viewType === CollectionViewType.Docking ? (null) :
<>
- {DashboardToggleButton(doc, "hidden", "eye-slash", "eye")}
+ {DashboardToggleButton(doc, "hidden", "eye-slash", "eye", () => {
+ doc.hidden = doc.hidden ? undefined : true;
+ if (!doc.hidden) {
+ DocFocusOrOpen(doc, props?.ContainingCollectionDoc);
+ }
+ })}
{DashboardToggleButton(doc, "lockedPosition", "lock", "unlock")}
</>;
}