Skip to content

Commit

Permalink
Merge pull request #7097 from gasparbarancelli/2318
Browse files Browse the repository at this point in the history
Responsive Lightbox #2318
  • Loading branch information
cagataycivici authored Jan 23, 2019
2 parents 05d67fc + cdf74de commit dfddc24
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/components/lightbox/lightbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,10 @@ export class Lightbox implements AfterViewInit,OnDestroy {

content.style.width = imageWidth + 'px';
content.style.height = imageHeight + 'px';
this.panel.style.left = parseInt(this.panel.style.left) + (DomHandler.getOuterWidth(this.panel) - imageWidth) / 2 + 'px';
this.panel.style.top = parseInt(this.panel.style.top) + (DomHandler.getOuterHeight(this.panel) - imageHeight) / 2 + 'px';
this.panel.style.marginLeft = `-${imageWidth / 2}px`;
this.panel.style.marginTop = `-${imageHeight / 2}px`;
this.panel.style.left = '50%';
this.panel.style.top = '50%';

setTimeout(() => {
this.cd.markForCheck();
Expand Down

0 comments on commit dfddc24

Please sign in to comment.