Skip to content

Commit

Permalink
Refactor #11561
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Jun 8, 2022
1 parent e277932 commit 4184d1d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/app/components/image/image.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
top: 0;
right: 0;
display: flex;
z-index: 1;
}

.p-image-action.p-link {
Expand Down
11 changes: 3 additions & 8 deletions src/app/components/image/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { ZIndexUtils } from 'primeng/utils';
</ng-template>
</div>
<div #mask class="p-image-mask p-component-overlay p-component-overlay-enter" *ngIf="maskVisible" (click)="onMaskClick()">
<div #toolbar class="p-image-toolbar" (click)="handleToolbarClick($event)">
<div class="p-image-toolbar" (click)="handleToolbarClick($event)">
<button class="p-image-action p-link" (click)="rotateRight()" type="button">
<i class="pi pi-refresh"></i>
</button>
Expand Down Expand Up @@ -94,8 +94,6 @@ export class Image implements AfterContentInit {

@ViewChild('mask') mask: ElementRef;

@ViewChild('toolbar') toolbarViewChild: ElementRef;

@ContentChildren(PrimeTemplate) templates: QueryList<any>;

indicatorTemplate: TemplateRef<any>;
Expand Down Expand Up @@ -202,8 +200,7 @@ export class Image implements AfterContentInit {
onAnimationEnd(event: AnimationEvent) {
switch(event.toState) {
case 'void':
ZIndexUtils.clear(this.container);
this.toolbarViewChild.nativeElement.style.zIndex = '';
ZIndexUtils.clear(this.wrapper);
this.maskVisible = false;
this.container = null;
this.wrapper = null;
Expand All @@ -217,9 +214,7 @@ export class Image implements AfterContentInit {
}

moveOnTop() {
ZIndexUtils.set('modal', this.container, this.config.zIndex.modal);
this.wrapper.style.zIndex = String(parseInt(this.container.style.zIndex, 10) - 1);
this.toolbarViewChild.nativeElement.style.zIndex = String(ZIndexUtils.get(this.wrapper) + 2);
ZIndexUtils.set('modal', this.wrapper, this.config.zIndex.modal);
}

appendContainer() {
Expand Down

0 comments on commit 4184d1d

Please sign in to comment.