Skip to content

Commit d40d697

Browse files
committed
1 parent 1183ee9 commit d40d697

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

build/jodit.min.css

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/jodit.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jodit",
3-
"version": "3.0.13",
3+
"version": "3.0.14",
44
"description": "Jodit is awesome and usefully wysiwyg editor with filebrowser",
55
"main": "index.js",
66
"scripts": {

src/plugins/resizer.ts

+10-5
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ Jodit.plugins.Resizer = function (editor: Jodit) {
9595
top: number = parseInt(resizer.style.top, 10),
9696
width: number = resizer.offsetWidth,
9797
height: number = resizer.offsetHeight;
98+
9899
// 1 - because need move border higher and toWYSIWYG the left than the picture
99100
// 2 - in box-sizing: border-box mode width is real width indifferent by border-width.
100101
if (top !== pos.top - 1 || left !== pos.left - 1 || width !== currentElement.offsetWidth || height !== currentElement.offsetHeight) {
@@ -103,11 +104,13 @@ Jodit.plugins.Resizer = function (editor: Jodit) {
103104
resizer.style.width = currentElement.offsetWidth + 'px';
104105
resizer.style.height = currentElement.offsetHeight + 'px';
105106

106-
editor.events.fire(currentElement, 'changesize');
107+
if (editor.events) {
108+
editor.events.fire(currentElement, 'changesize');
107109

108-
// check for first init. Ex. inlinePopup hides when it was fired
109-
if (!isNaN(left)) {
110-
editor.events.fire('resize');
110+
// check for first init. Ex. inlinePopup hides when it was fired
111+
if (!isNaN(left)) {
112+
editor.events.fire('resize');
113+
}
111114
}
112115
}
113116
}
@@ -164,7 +167,9 @@ Jodit.plugins.Resizer = function (editor: Jodit) {
164167
if (currentElement.tagName === 'IMG' && !(<HTMLImageElement>currentElement).complete) {
165168
currentElement.addEventListener('load', function ElementOnLoad() {
166169
updateSize();
167-
currentElement.removeEventListener('load', ElementOnLoad);
170+
if (currentElement) {
171+
currentElement.removeEventListener('load', ElementOnLoad);
172+
}
168173
});
169174
}
170175
clearTimeout(timer);

0 commit comments

Comments
 (0)