Skip to content

Commit

Permalink
correct handling of closing popup
Browse files Browse the repository at this point in the history
  • Loading branch information
coastforge-fsc committed Jan 10, 2024
1 parent 1947d6c commit 58e6ffc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Resources/public/js/c4g-popup-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class C4gPopupController {
this.mapData.map.removeOverlay(this.popups[0].popup);
}
else if (this.popups[0] && this.popups[0].popupComponent) {
this.popups[0].popupComponent.close();
this.popups[0].popupComponent.close(true);
}
}
}
6 changes: 3 additions & 3 deletions src/Resources/public/js/components/c4g-popup-container.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class PopupContainer extends Component {
<div className={"c4g-popup-wrapper"}>
<Suspense fallback={<div>Loading...</div>}>
<Titlebar wrapperClass={headerClass} headerClass={"c4g-popup-header-headline"} header={this.props.mapData.popupHeadline || ""}
closeBtnClass={"c4g-titlebar-close"} closeBtnCb={this.close} closeBtnTitle={this.language.CLOSE}
closeBtnClass={"c4g-titlebar-close"} closeBtnCb={() => {this.close(true)}} closeBtnTitle={this.language.CLOSE}
detailBtnClass={""} detailBtnCb={""}>
{addButtons}
</Titlebar>
Expand Down Expand Up @@ -101,11 +101,11 @@ export class PopupContainer extends Component {
});
}

close() {
close(boolean = false) {
if (this.props.mapData.caching) {
utils.storeValue('popupInfos', "");
}
if (this.state.activeComps) {
if (boolean && this.state.activeComps) {
for (let i in this.state.activeComps) {
if (this.state.activeComps.hasOwnProperty(i)) {
let comp = this.state.activeComps[i];
Expand Down

0 comments on commit 58e6ffc

Please sign in to comment.