Commit 7b5109dd authored by webchick's avatar webchick

Issue #2092871 by Wim Leers: Fixed width and height attributes are empty when inserting an image.

parent bb925230
......@@ -89,8 +89,8 @@ CKEDITOR.plugins.add('drupalimage', {
imageDOMElement = imageElement.$;
// Width and height are populated by actual dimensions.
existingValues.width = imageDOMElement ? imageDOMElement.width : '';
existingValues.height = imageDOMElement ? imageDOMElement.height : '';
existingValues.width = imageDOMElement ? imageDOMElement.naturalWidth : '';
existingValues.height = imageDOMElement ? imageDOMElement.naturalHeight : '';
// Populate all other attributes by their specified attribute values.
var attribute = null, attributeName;
for (var key = 0; key < imageDOMElement.attributes.length; key++) {
......
......@@ -114,6 +114,13 @@ CKEDITOR.plugins.add('drupalimagecaption', {
if (this.data.data_align) {
el.attributes['data-align'] = this.data.data_align;
}
if (!this.data.width) {
el.attributes['data-cke-saved-width'] = this.parts.image.$.naturalWidth;
}
if (!this.data.height) {
el.attributes['data-cke-saved-height'] = this.parts.image.$.naturalHeight;
}
},
_selectionWillCreateInlineImage: function () {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment