diff options
| author | madelinegr <mgriswold99@gmail.com> | 2019-06-11 17:52:18 -0400 |
|---|---|---|
| committer | madelinegr <mgriswold99@gmail.com> | 2019-06-11 17:52:18 -0400 |
| commit | f9b472e6d69fcb99b8139cfcd6c36a8277962251 (patch) | |
| tree | b5a460959ac989100cc7dc4ba3b96d14ed7dbe9b /src/client/views/presentationview/PresentationElement.tsx | |
| parent | caf61bef345db0addd37c03bf2d0b0d2dd724c47 (diff) | |
Saving PresStatus Not Done, THere are bugs
Diffstat (limited to 'src/client/views/presentationview/PresentationElement.tsx')
| -rw-r--r-- | src/client/views/presentationview/PresentationElement.tsx | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/src/client/views/presentationview/PresentationElement.tsx b/src/client/views/presentationview/PresentationElement.tsx index f346940a2..7928722f2 100644 --- a/src/client/views/presentationview/PresentationElement.tsx +++ b/src/client/views/presentationview/PresentationElement.tsx @@ -1,7 +1,7 @@ import { observer } from "mobx-react"; import React = require("react"); -import { Doc } from "../../../new_fields/Doc"; -import { NumCast, BoolCast, StrCast } from "../../../new_fields/Types"; +import { Doc, DocListCast } from "../../../new_fields/Doc"; +import { NumCast, BoolCast, StrCast, Cast } from "../../../new_fields/Types"; import { Id } from "../../../new_fields/FieldSymbols"; import { observable, action, computed } from "mobx"; import "./PresentationView.scss"; @@ -10,6 +10,8 @@ import { library } from '@fortawesome/fontawesome-svg-core'; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faFile as fileSolid, faLocationArrow, faArrowUp, faSearch } from '@fortawesome/free-solid-svg-icons'; import { faFile as fileRegular } from '@fortawesome/free-regular-svg-icons'; +import { List } from "../../../new_fields/List"; +import { listSpec } from "../../../new_fields/Schema"; @@ -29,6 +31,8 @@ interface PresentationElementProps { allListElements: Doc[]; groupMappings: Map<String, Doc[]>; presStatus: boolean; + presButtonBackUp: Doc; + presGroupBackUp: Doc; } @@ -60,6 +64,22 @@ export default class PresentationElement extends React.Component<PresentationEle get selected() { return this.selectedButtons; } + @action + componentDidMount() { + // let castedList = Cast(this.props.presButtonBackUp.selectedButtons, listSpec(Doc), null) as any as List<List<boolean>>; + let castedList = DocListCast(this.props.presButtonBackUp.selectedButtonDocs); + if (castedList.length !== 0) { + // this.selectedButtons = castedList; + let selectedButtonOfDoc = Cast(castedList[this.props.index].selectedButtons, listSpec("boolean"), null); + if (selectedButtonOfDoc !== undefined) { + this.selectedButtons = selectedButtonOfDoc; + } + console.log("Entered!!"); + + } + console.log("Mounted!!"); + //this.props.presButtonBackUp.elIndex = this.props.index; + } /** * The function that is called to group docs together. It tries to group a doc @@ -171,6 +191,16 @@ export default class PresentationElement extends React.Component<PresentationEle } } } + this.autoSaveButtonChange(buttonIndex.HideTillPressed); + } + + @action + autoSaveButtonChange = (index: buttonIndex) => { + // let castedList = Cast(this.props.presButtonBackUp.selectedButtons, listSpec(Doc), null) as any as List<List<boolean>>; + let castedList = DocListCast(this.props.presButtonBackUp.selectedButtonDocs); + castedList[this.props.index].selectedButtons = new List(this.selectedButtons); + + //this.props.mainDocument.presButtonBackUp = this.props.presButtonBackUp; } /** @@ -198,6 +228,8 @@ export default class PresentationElement extends React.Component<PresentationEle } } } + this.autoSaveButtonChange(buttonIndex.HideAfter); + } /** @@ -225,6 +257,8 @@ export default class PresentationElement extends React.Component<PresentationEle } } } + this.autoSaveButtonChange(buttonIndex.FadeAfter); + } /** @@ -239,6 +273,9 @@ export default class PresentationElement extends React.Component<PresentationEle } else { this.selectedButtons[buttonIndex.Navigate] = true; } + + this.autoSaveButtonChange(buttonIndex.Navigate); + } |
