opentiny 6.9.21 → 6.9.22
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/package.json +1 -1
- package/tinymce.js +3 -2
- package/tinymce.min.js +1 -1
package/package.json
CHANGED
package/tinymce.js
CHANGED
|
@@ -26295,8 +26295,9 @@
|
|
|
26295
26295
|
const img = new Image();
|
|
26296
26296
|
img.src = blobInfo.blobUri();
|
|
26297
26297
|
img.onload = () => {
|
|
26298
|
-
const contentBodyElement = editor.dom.select('.mce-content-body')[0];
|
|
26299
|
-
const
|
|
26298
|
+
const contentBodyElement = editor.dom.select('.mce-content-body')[0].children[0];
|
|
26299
|
+
const computedStyles = contentBodyElement ? window.getComputedStyle(contentBodyElement) : null;
|
|
26300
|
+
const maxImageWidth = computedStyles ? parseInt(computedStyles.width) - parseInt(computedStyles.paddingLeft) - parseInt(computedStyles.paddingRight) : defaultMaxImageWidthPx;
|
|
26300
26301
|
const imageWidth = Math.min(img.naturalWidth, maxImageWidth);
|
|
26301
26302
|
pasteHtml(editor, `<img src="${ blobInfo.blobUri() }" width="${ imageWidth }px">`, false, true);
|
|
26302
26303
|
};
|