@wertzui/ngx-restworld-client 4.2.1 → 4.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/views/restworld-image-view/restworld-image-view.component.mjs +7 -8
- package/fesm2015/wertzui-ngx-restworld-client.mjs +7 -8
- package/fesm2015/wertzui-ngx-restworld-client.mjs.map +1 -1
- package/fesm2020/wertzui-ngx-restworld-client.mjs +6 -7
- package/fesm2020/wertzui-ngx-restworld-client.mjs.map +1 -1
- package/lib/views/restworld-image-view/restworld-image-view.component.d.ts +4 -2
- package/package.json +1 -1
|
@@ -27,7 +27,6 @@ import * as i2 from 'primeng/fileupload';
|
|
|
27
27
|
import { FileUpload, FileUploadModule } from 'primeng/fileupload';
|
|
28
28
|
import * as i3 from 'primeng/dialog';
|
|
29
29
|
import { Dialog, DialogModule } from 'primeng/dialog';
|
|
30
|
-
import { firstValueFrom } from 'rxjs';
|
|
31
30
|
import * as i1$2 from 'primeng/button';
|
|
32
31
|
import { ButtonModule } from 'primeng/button';
|
|
33
32
|
import * as i5 from 'primeng/colorpicker';
|
|
@@ -630,14 +629,14 @@ class RESTWorldImageViewComponent {
|
|
|
630
629
|
if (!this.backgroundColor)
|
|
631
630
|
this.backgroundColor = '#ffffff';
|
|
632
631
|
}
|
|
632
|
+
ngOnDestroy() {
|
|
633
|
+
this._subscriptions?.forEach(s => s.unsubscribe());
|
|
634
|
+
}
|
|
633
635
|
ngAfterViewInit() {
|
|
634
|
-
// We need to trigger
|
|
635
|
-
// Otherwise the image cropper thinks that the image size is 0x0,
|
|
636
|
+
// We need to trigger imageLoadedInView each time, after the opening animation of the dialog has been completed.
|
|
637
|
+
// Otherwise the image cropper initially (and after every window resize) thinks that the image size is 0x0,
|
|
636
638
|
// because the opening animation hast just begun when the image cropper is first shown.
|
|
637
|
-
this.dialogs?.
|
|
638
|
-
await firstValueFrom(d.onShow);
|
|
639
|
-
this.imageCroppers?.forEach(i => i.onResize());
|
|
640
|
-
});
|
|
639
|
+
this.dialogs?.map(d => d.onShow.subscribe(() => this.imageCroppers?.forEach(i => { i.imageLoadedInView(); })));
|
|
641
640
|
}
|
|
642
641
|
showCropDialog() {
|
|
643
642
|
this.displayCropDialog = true;
|