aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/presentationview/PresentationView.tsx
diff options
context:
space:
mode:
authorMohammad Amoush <mohammad_amoush@brown.edu>2019-07-24 11:00:09 -0400
committerMohammad Amoush <mohammad_amoush@brown.edu>2019-07-24 11:00:09 -0400
commit5591060e868053c8839fcc1de1ae77d4dac361ac (patch)
treecd2ec5a046686e5cf481a157fbebbcc479368282 /src/client/views/presentationview/PresentationView.tsx
parent2edcfb8a755b7fec7f937f135c794cbadbe0c94e (diff)
parent7fce10e6d687364feac6fd93a362634018a9f3ee (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into youtube-api-muhammed
Diffstat (limited to 'src/client/views/presentationview/PresentationView.tsx')
-rw-r--r--src/client/views/presentationview/PresentationView.tsx13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/client/views/presentationview/PresentationView.tsx b/src/client/views/presentationview/PresentationView.tsx
index f80840f96..b318f0321 100644
--- a/src/client/views/presentationview/PresentationView.tsx
+++ b/src/client/views/presentationview/PresentationView.tsx
@@ -31,6 +31,8 @@ export interface PresViewProps {
Documents: List<Doc>;
}
+const expandedWidth = 400;
+
@observer
export class PresentationView extends React.Component<PresViewProps> {
public static Instance: PresentationView;
@@ -67,6 +69,15 @@ export class PresentationView extends React.Component<PresViewProps> {
PresentationView.Instance = this;
}
+ @action
+ toggle = (forcedValue: boolean | undefined) => {
+ if (forcedValue !== undefined) {
+ this.curPresentation.width = forcedValue ? expandedWidth : 0;
+ } else {
+ this.curPresentation.width = this.curPresentation.width === expandedWidth ? 0 : expandedWidth;
+ }
+ }
+
//The first lifecycle function that gets called to set up the current presentation.
async componentWillMount() {
this.props.Documents.forEach(async (doc, index: number) => {
@@ -543,7 +554,7 @@ export class PresentationView extends React.Component<PresViewProps> {
this.curPresentation.data = new List([doc]);
}
- this.curPresentation.width = 400;
+ this.toggle(true);
}
//Function that sets the store of the children docs.