aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/PropertiesButtons.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-02-15 15:01:06 -0500
committerbobzel <zzzman@gmail.com>2021-02-15 15:01:06 -0500
commitbd5ca49636c5ff0d480003f9479cf40a562b4589 (patch)
tree8b1295e153af765970f3adb4cc6bb4b8f30ae8b6 /src/client/views/PropertiesButtons.tsx
parentddf37d997ded0faa87c844b02f4df1b98989fd2e (diff)
cleaned up showTitle and showAudio stuff just a bit.
Diffstat (limited to 'src/client/views/PropertiesButtons.tsx')
-rw-r--r--src/client/views/PropertiesButtons.tsx13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/client/views/PropertiesButtons.tsx b/src/client/views/PropertiesButtons.tsx
index 9a836313c..53a017592 100644
--- a/src/client/views/PropertiesButtons.tsx
+++ b/src/client/views/PropertiesButtons.tsx
@@ -6,7 +6,7 @@ import { observer } from "mobx-react";
import { Doc } from "../../fields/Doc";
import { InkField } from '../../fields/InkField';
import { RichTextField } from '../../fields/RichTextField';
-import { Cast, NumCast } from "../../fields/Types";
+import { Cast, NumCast, StrCast } from "../../fields/Types";
import { ImageField } from '../../fields/URLField';
import { GoogleAuthenticationManager } from '../apis/GoogleAuthenticationManager';
import { Pulls, Pushes } from '../apis/google_docs/GoogleApiClientUtils';
@@ -222,10 +222,7 @@ export class PropertiesButtons extends React.Component<{}, {}> {
}
@undoBatch
- @action
- setDictation = () => {
- SelectionManager.Views().forEach(dv => dv.rootDoc._showAudio = dv.rootDoc._showAudio === !dv.rootDoc._showAudio);
- }
+ setDictation = () => SelectionManager.Views().forEach(dv => dv.rootDoc._showAudio = !dv.rootDoc._showAudio);
@computed
get dictationButton() {
@@ -244,7 +241,7 @@ export class PropertiesButtons extends React.Component<{}, {}> {
@undoBatch
@action
setTitle = () => {
- SelectionManager.Views().forEach(dv => dv.rootDoc._showTitle = dv.rootDoc._showTitle === undefined ? "title" : undefined);
+ SelectionManager.Views().forEach(dv => dv.rootDoc._showTitle = !dv.rootDoc._showTitle ? "title" : dv.rootDoc._showTitle === "title" ? "title:hover" : undefined);
}
@computed
@@ -252,7 +249,7 @@ export class PropertiesButtons extends React.Component<{}, {}> {
const targetDoc = this.selectedDoc;
return !targetDoc ? (null) : <Tooltip title={<div className="dash-tooltip">{"Show Title Header"}</div>} placement="top">
<div>
- <div className={`propertiesButtons-linkButton-empty toggle-${targetDoc._showTitle ? "on" : "off"}`} onPointerDown={this.setTitle}>
+ <div className={`propertiesButtons-linkButton-empty toggle-${targetDoc._showTitle === "title" ? "on" : StrCast(targetDoc._showTitle).includes(":hover") ? "hover" : "off"}`} onPointerDown={this.setTitle}>
<FontAwesomeIcon className="propertiesButtons-icon" icon="text-width" size="lg" />
</div>
<div className="propertiesButtons-title"> Title </div>
@@ -502,7 +499,7 @@ export class PropertiesButtons extends React.Component<{}, {}> {
<div className="propertiesButtons-button">
{this.lockButton}
</div>
- <div className="propertiesButtons-button" style={{ display: isText || isImage ? "" : "none" }}>
+ <div className="propertiesButtons-button">
{this.dictationButton}
</div>
<div className="propertiesButtons-button">