@worktile/theia 20.1.0-next.8 → 20.1.0-next.9
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.
|
@@ -14368,11 +14368,17 @@ class TheImage extends TheBaseElement {
|
|
|
14368
14368
|
super.ngOnDestroy();
|
|
14369
14369
|
}
|
|
14370
14370
|
cacheImageHeight(height) {
|
|
14371
|
+
if (!AngularEditor.isEnabledVirtualScroll(this.editor)) {
|
|
14372
|
+
return;
|
|
14373
|
+
}
|
|
14371
14374
|
const heights = ELEMENT_KEY_TO_HEIGHTS.get(this.editor);
|
|
14372
14375
|
const key = AngularEditor.findKey(this.editor, this.element);
|
|
14373
14376
|
heights.set(key.id, height);
|
|
14374
14377
|
}
|
|
14375
14378
|
setImageMinHeight() {
|
|
14379
|
+
if (!AngularEditor.isEnabledVirtualScroll(this.editor)) {
|
|
14380
|
+
return;
|
|
14381
|
+
}
|
|
14376
14382
|
const heights = ELEMENT_KEY_TO_HEIGHTS.get(this.editor);
|
|
14377
14383
|
const key = AngularEditor.findKey(this.editor, this.element);
|
|
14378
14384
|
if (heights && heights.get(key.id)) {
|
|
@@ -14384,6 +14390,9 @@ class TheImage extends TheBaseElement {
|
|
|
14384
14390
|
}
|
|
14385
14391
|
}
|
|
14386
14392
|
clearMinHeight() {
|
|
14393
|
+
if (!AngularEditor.isEnabledVirtualScroll(this.editor)) {
|
|
14394
|
+
return;
|
|
14395
|
+
}
|
|
14387
14396
|
const blockCard = getBlockCardByNativeElement(this.nativeElement);
|
|
14388
14397
|
if (blockCard) {
|
|
14389
14398
|
blockCard.style.minHeight = '';
|
|
@@ -14630,9 +14639,11 @@ class TheImage extends TheBaseElement {
|
|
|
14630
14639
|
const img = event.target;
|
|
14631
14640
|
this.naturalWidth = img.naturalWidth;
|
|
14632
14641
|
this.naturalHeight = img.naturalHeight;
|
|
14633
|
-
|
|
14634
|
-
this.
|
|
14635
|
-
|
|
14642
|
+
if (AngularEditor.isEnabledVirtualScroll(this.editor)) {
|
|
14643
|
+
this.imageLoadedCacheHeightTimer = setTimeout(() => {
|
|
14644
|
+
this.cacheImageHeight(this.getRealHeight());
|
|
14645
|
+
}, 0);
|
|
14646
|
+
}
|
|
14636
14647
|
}
|
|
14637
14648
|
imageError(event) {
|
|
14638
14649
|
const img = event.target;
|