From e88538bb8af2ba648da2326d0f6edd3e0186766e Mon Sep 17 00:00:00 2001 From: Mohammad Amoush Date: Thu, 20 Jun 2019 15:45:07 -0400 Subject: Title changing to presentations added --- .../views/presentationview/PresentationView.tsx | 38 +++++++++++++++++----- 1 file changed, 30 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/client/views/presentationview/PresentationView.tsx b/src/client/views/presentationview/PresentationView.tsx index 474001523..905117cd1 100644 --- a/src/client/views/presentationview/PresentationView.tsx +++ b/src/client/views/presentationview/PresentationView.tsx @@ -13,7 +13,7 @@ import { CurrentUserUtils } from "../../../server/authentication/models/current_ import PresentationElement, { buttonIndex } from "./PresentationElement"; import { library } from '@fortawesome/fontawesome-svg-core'; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { faArrowRight, faArrowLeft, faPlay, faStop, faPlus, faTimes, faMinus } from '@fortawesome/free-solid-svg-icons'; +import { faArrowRight, faArrowLeft, faPlay, faStop, faPlus, faTimes, faMinus, faEdit } from '@fortawesome/free-solid-svg-icons'; import { Docs } from "../../documents/Documents"; library.add(faArrowLeft); @@ -23,6 +23,8 @@ library.add(faStop); library.add(faPlus); library.add(faTimes); library.add(faMinus); +library.add(faEdit); + export interface PresViewProps { Documents: List; @@ -136,6 +138,7 @@ export class PresentationView extends React.Component { @observable PresTitleInputOpen: boolean = false; //Variable that holds reference to title input, so that new presentations get titles assigned. @observable titleInputElement: HTMLInputElement | undefined; + @observable PresTitleChangeOpen: boolean = false; //initilize class variables constructor(props: PresViewProps) { @@ -664,7 +667,6 @@ export class PresentationView extends React.Component { */ @action addNewPresentation = (presTitle: string) => { - //let title = "Presentation " + (this.props.Documents.length + 1); let newPresentationDoc = Docs.TreeDocument([], { title: presTitle }); this.props.Documents.push(newPresentationDoc); this.curPresentation = newPresentationDoc; @@ -700,7 +702,7 @@ export class PresentationView extends React.Component { */ renderSelectOrPresSelection = () => { let presentationList = DocListCast(this.props.Documents); - if (this.PresTitleInputOpen) { + if (this.PresTitleInputOpen || this.PresTitleChangeOpen) { return this.titleInputElement = e!} type="text" className="presentationView-title" placeholder="Enter Name!" onKeyDown={this.submitPresentationTitle} />; } else { return