Skip to content

Commit 9b08006

Browse files
authored
Merge pull request #53 from mendix/bugfix/ticket49079
Possible bugfix image dimensions
2 parents 1a85d20 + 7fd9d40 commit 9b08006

6 files changed

Lines changed: 18 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "CKEditorForMendix",
3-
"version": "2.4.3",
3+
"version": "2.4.4",
44
"description": "A new WYSIWYG editor for Mendix that also has the ability to create MicroFlow links in your HTML output.",
55
"license": "Apache License, Version 2",
66
"author": "Mendix",

src/CKEditorForMendix/CKEditorForMendix.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,11 @@
324324
<category>Images</category>
325325
<description>This constraint might be used to filter the set of browsable images. (not functional right now)</description>
326326
</property>
327+
<property key="useImageStyleProperty" type="boolean" defaultValue="true">
328+
<caption>Use image style size</caption>
329+
<category>Images</category>
330+
<description>This will use the normal 'style' property on an image to set the dimensions. If you set this false, it will set the width and height as a normal html property. This is sometimes needed when using images in document templates (PDF generation)</description>
331+
</property>
327332
<!--
328333
COUNT
329334
-->

src/CKEditorForMendix/widget/CKEditorForMendix.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,11 @@ define([
250250
config.resize_enabled = false;
251251
}
252252

253+
if (!this.useImageStyleProperty) {
254+
config.disallowedContent = "img{width,height}";
255+
config.extraAllowedContent = "*[data-*];img[width,height]";
256+
}
257+
253258
// Autogrow functionality of the editor.
254259
if (this.width > 0) {
255260
config.width = this.width;
@@ -322,6 +327,12 @@ define([
322327
}
323328
});
324329

330+
if (!this.useImageStyleProperty) {
331+
event.editor.filter.addTransformations([
332+
["img{width,height}: sizeToStyle", "img[width,height]: sizeToAttribute"]
333+
]);
334+
}
335+
325336
this._updateRendering(callback);
326337
}));
327338

src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="CKEditorForMendix" version="2.4.3" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="CKEditorForMendix" version="2.4.4" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="CKEditorForMendix/CKEditorForMendix.xml"/>
66
<widgetFile path="CKEditorForMendix/CKEditorViewerForMendix.xml"/>

test/Test.mpr

28 KB
Binary file not shown.

test/widgets/CKEditorForMendix.mpk

227 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)