Skip to content
This repository has been archived by the owner on May 4, 2019. It is now read-only.

Commit

Permalink
feat(item-bank): add event to load irv accommodations
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Horne committed Aug 24, 2018
1 parent 6b30cd0 commit 38f3f44
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/ItemBank/ItemBankContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,18 @@ export class ItemBankContainer extends React.Component<

if (currentItem) {
const isaap = toiSAAP(accGroups);
const newItem = { ...currentItem, isaap };
this.props.setUrl(currentItem);
this.setState({ currentItem });
const x = document.getElementsByTagName("iframe")[0].contentWindow;
const event = new CustomEvent("acc-update", { detail: newItem.isaap });
if (x !== null) {
x.dispatchEvent(event);
}
this.bubbleEventHandler(currentItem, isaap);
}
};

bubbleEventHandler = (currentItem: ItemRevisionModel, isaap: string) => {
const newItem = { ...currentItem, isaap };
const x = document;
const event = new CustomEvent("acc-update", { detail: newItem.isaap });
if (x !== null) {
x.dispatchEvent(event);
}
};

Expand Down

0 comments on commit 38f3f44

Please sign in to comment.