Skip to content

Commit

Permalink
Merge pull request #923 from gregory-bretall/issue-901-updated
Browse files Browse the repository at this point in the history
Change dragresize implementation on IE to modify heigh and width insi…
  • Loading branch information
julien authored Nov 26, 2018
2 parents 8b3925b + ff4b6da commit 7f87818
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
13 changes: 5 additions & 8 deletions src/plugins/dragresize_ie.js
Original file line number Diff line number Diff line change
Expand Up @@ -878,10 +878,9 @@
// Don't update attributes if less than 10.
// This is to prevent images to visually disappear.
if (newWidth >= 15 && (newHeight >= 15 || newHeight === 'auto')) {
image.setAttributes({
width: newWidth,
height: newHeight
});
image.$.style.width = newWidth + 'px';
image.$.style.height = newHeight + 'px';

updateData = true;
} else {
updateData = false;
Expand All @@ -902,10 +901,8 @@
resizer.removeClass('cke_image_resizing');

if (updateData) {
widget.setData({
height: newHeight,
width: newWidth
});
widget.element.$.style.width = newWidth + 'px';
widget.element.$.style.height = newHeight + 'px';

// Save another undo snapshot: after resizing.
editor.fire('saveSnapshot');
Expand Down
7 changes: 5 additions & 2 deletions src/plugins/dragresize_ie11.js
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,9 @@
// Don't update attributes if less than 10.
// This is to prevent images to visually disappear.
if ( newWidth >= 15 && newHeight >= 15 ) {
image.setAttributes( { width: newWidth, height: newHeight } );
image.$.style.width = newWidth + 'px';
image.$.style.height = newHeight + 'px';

updateData = true;
} else {
updateData = false;
Expand All @@ -1316,7 +1318,8 @@
resizer.removeClass( 'cke_image_resizing' );

if ( updateData ) {
widget.setData( { width: newWidth, height: newHeight } );
widget.element.$.style.width = newWidth + 'px';
widget.element.$.style.height = newHeight + 'px';

// Save another undo snapshot: after resizing.
editor.fire( 'saveSnapshot' );
Expand Down

0 comments on commit 7f87818

Please sign in to comment.