aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/presentationview/PresentationElement.tsx
diff options
context:
space:
mode:
authormadelinegr <mgriswold99@gmail.com>2019-06-06 16:45:32 -0400
committermadelinegr <mgriswold99@gmail.com>2019-06-06 16:45:32 -0400
commit51c59893afd84eb9f36669282cbf0479ee9d9f84 (patch)
treec1215e449b3442a000c80541824cd24b8a80bc7a /src/client/views/presentationview/PresentationElement.tsx
parenta794da35a96ba278e20a76591de86cac6ce44969 (diff)
Cleaned the ex implementation
Diffstat (limited to 'src/client/views/presentationview/PresentationElement.tsx')
-rw-r--r--src/client/views/presentationview/PresentationElement.tsx88
1 files changed, 0 insertions, 88 deletions
diff --git a/src/client/views/presentationview/PresentationElement.tsx b/src/client/views/presentationview/PresentationElement.tsx
index eb7002731..f5220c564 100644
--- a/src/client/views/presentationview/PresentationElement.tsx
+++ b/src/client/views/presentationview/PresentationElement.tsx
@@ -15,7 +15,6 @@ interface PresentationElementProps {
index: number;
deleteDocument(index: number): void;
gotoDocument(index: number): void;
- groupedMembers: Doc[][];
allListElements: Doc[];
groupMappings: Map<String, Doc[]>;
@@ -45,12 +44,9 @@ export default class PresentationElement extends React.Component<PresentationEle
let newGuid = Utils.GenerateGuid();
let aboveGuid = StrCast(p.allListElements[index - 1].presentId, null);
let docGuid = StrCast(document.presentId, null);
- // if (aboveGuid !== undefined) {
if (p.groupMappings.has(aboveGuid)) {
let aboveArray = p.groupMappings.get(aboveGuid)!;
if (p.groupMappings.has(docGuid)) {
- console.log("Doc Guid: ", docGuid);
- console.log("Above Guid: ", aboveGuid);
let docsArray = p.groupMappings.get(docGuid)!;
docsArray.forEach((doc: Doc) => {
if (!aboveArray.includes(doc)) {
@@ -91,27 +87,6 @@ export default class PresentationElement extends React.Component<PresentationEle
}
document.presentId = aboveGuid;
- // } else {
- // p.allListElements[index - 1].presentId = newGuid;
- // let newAboveArray: Doc[] = [];
- // newAboveArray.push(p.allListElements[index - 1]);
- // if (p.groupMappings.has(docGuid)) {
- // let docsArray = p.groupMappings.get(docGuid)!;
- // docsArray.forEach((doc: Doc) => {
- // doc.presentId = newGuid;
- // newAboveArray.push(doc);
- // });
- // p.groupMappings.delete(docGuid);
- // } else {
- // newAboveArray.push(document);
- // }
- // document.presentId = newGuid;
- // p.groupMappings.set(newGuid, newAboveArray);
- // console.log("New Array created");
-
-
- // }
-
} else {
let curArray = p.groupMappings.get(StrCast(document.presentId, Utils.GenerateGuid()))!;
let targetIndex = curArray.indexOf(document);
@@ -130,64 +105,6 @@ export default class PresentationElement extends React.Component<PresentationEle
}
@action
- onGroupClickRec = (document: Doc, index: number, buttonStatus: boolean) => {
- let p = this.props;
- if (buttonStatus) {
- if (index >= 1) {
- if (p.groupedMembers[index].length >= 0) {
- p.groupedMembers[index].forEach((doc: Doc) => {
- if (!p.groupedMembers[index - 1].includes(doc)) {
- p.groupedMembers[index - 1].push(doc);
- }
- });
- }
-
- if (index >= 2) {
- let nextBool = p.groupedMembers[index - 2].length !== 1;
- if (nextBool === buttonStatus) {
- this.onGroupClickRec(document, index - 1, p.groupedMembers[index - 2].length !== 1);
- }
- }
-
- }
- }
- else {
-
- if (index >= 1) {
- let removeSize = p.groupedMembers[index].length;
- if (p.groupedMembers[index].length >= 0) {
- p.groupedMembers[index].forEach((doc: Doc) => {
- p.groupedMembers[index - 1].pop(); console.log("Reached!!");
- });
- }
-
- if (index >= 2) {
- let nextBool = p.groupedMembers[index - 2].length !== 1;
- if (nextBool !== buttonStatus) {
- this.recursiveDeleteGroups(index - 1, removeSize);
- }
- }
- }
- }
-
- }
-
- @action
- recursiveDeleteGroups = (index: number, removeSize: number) => {
- let p = this.props;
- for (let i = 0; i < removeSize; i++) {
- p.groupedMembers[index - 1].pop();
- }
- if (index >= 2) {
-
- let nextBool = p.groupedMembers[index - 2].length !== 1;
- if (nextBool === true) {
- this.recursiveDeleteGroups(index - 1, removeSize);
- }
- }
- }
-
- @action
changeGroupStatus = () => {
if (this.selectedButtons[buttonIndex.Group]) {
this.selectedButtons[buttonIndex.Group] = false;
@@ -196,10 +113,6 @@ export default class PresentationElement extends React.Component<PresentationEle
}
}
- printGroupSizes = () => {
- this.props.groupedMembers.forEach((doc: Doc[], index: number) => console.log("Index: ", index, " size: ", doc.length));
- }
-
@action
onHideDocumentUntilPressClick = (e: React.MouseEvent) => {
e.stopPropagation();
@@ -254,7 +167,6 @@ export default class PresentationElement extends React.Component<PresentationEle
e.stopPropagation();
this.changeGroupStatus();
this.onGroupClick(p.document, p.index, this.selectedButtons[buttonIndex.Group]);
- //this.printGroupSizes();
}}>F</button>
</div>