Skip to content

Commit

Permalink
Fix regression with media view
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidMStraub committed Oct 9, 2021
1 parent a195b01 commit 5095415
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/GrampsjsGallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export class GrampsjsGallery extends LitElement {
<div class="clear"></div>
<grampsjs-view-media-lightbox
active
id="gallery-lightbox-view"
@lightbox:left="${this._handleLeft}"
@lightbox:right="${this._handleRight}"
Expand Down Expand Up @@ -96,10 +97,9 @@ export class GrampsjsGallery extends LitElement {
_handleClick (i) {
if (!this.edit) {
const lightBoxView = this.shadowRoot.getElementById('gallery-lightbox-view')
const lightBox = lightBoxView.shadowRoot.getElementById('gallery-lightbox')
if (lightBox) {
if (lightBoxView) {
this._lightboxSelected = i
lightBox.open = true
lightBoxView.open()
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/views/GrampsjsViewMediaLightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ export class GrampsjsViewMediaLightbox extends GrampsjsView {
`
}

open () {
const lightBox = this.shadowRoot.getElementById('gallery-lightbox')
if (lightBox) {
lightBox.open = true
}
}


_innerContainerContent() {
if (Object.keys(this._data).length === 0) {
Expand Down

0 comments on commit 5095415

Please sign in to comment.