From 9705b629af74f75b8d7f8552e372d7b7e629f37b Mon Sep 17 00:00:00 2001 From: tiff Date: Mon, 23 Jul 2012 23:24:28 +0200 Subject: [PATCH] Remove allowObjectResizing config adopt inline styles after resizing an (fixes #157) --- src/editor.js | 2 -- src/views/composer.js | 38 ++++++++++++++++++++------------------ 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/editor.js b/src/editor.js index 9d7a36fb..6b10e160 100644 --- a/src/editor.js +++ b/src/editor.js @@ -52,8 +52,6 @@ stylesheets: [], // Placeholder text to use, defaults to the placeholder attribute on the textarea element placeholderText: undef, - // Whether the composer should allow the user to manually resize images, tables etc. - allowObjectResizing: true, // Whether the rich text editor should be rendered on touch devices (wysihtml5 >= 0.3.0 comes with basic support for iOS 5) supportTouchDevices: true }; diff --git a/src/views/composer.js b/src/views/composer.js index 0dea9330..e0cd9c85 100644 --- a/src/views/composer.js +++ b/src/views/composer.js @@ -41,8 +41,7 @@ try { this.element.innerHTML = html; - } - catch (e) { + } catch (e) { this.element.innerText = html; } }, @@ -285,35 +284,38 @@ _initObjectResizing: function() { var properties = ["width", "height"], propertiesLength = properties.length, - element = this.element; - - this.commands.exec("enableObjectResizing", this.config.allowObjectResizing); - - if (this.config.allowObjectResizing) { - // IE sets inline styles after resizing objects - // The following lines make sure that the width/height css properties - // are copied over to the width/height attributes - if (browser.supportsEvent("resizeend")) { - dom.observe(element, "resizeend", function(event) { + element = this.element, + adoptStyles = function(event) { var target = event.target || event.srcElement, style = target.style, i = 0, property; - for(; i