Fixed bug #14085: htmlArea RTE: Setting empty color raises js error in IE
authorStanislas Rolland <typo3@sjbr.ca>
Tue, 13 Apr 2010 05:19:47 +0000 (05:19 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Tue, 13 Apr 2010 05:19:47 +0000 (05:19 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7328 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Color/typo3color.js

index 45d46f6..31f2b39 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2010-04-13  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Follow-up to feature #14051: htmlArea RTE: Streamline the RTE loading process
+       * Fixed bug #14085: htmlArea RTE: Setting empty color raises js error in IE
 
 2010-04-13  Steffen Kamper  <info@sk-typo3.de>
 
index a5c93db..15fc6cd 100644 (file)
@@ -1,6 +1,7 @@
 2010-04-13  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Follow-up to feature #14051: htmlArea RTE: Streamline the RTE loading process
+       * Fixed bug #14085: htmlArea RTE: Setting empty color raises js error in IE
 
 2010-04-12  Stanislas Rolland  <typo3@sjbr.ca>
 
index f6c31c8..2397543 100644 (file)
@@ -338,7 +338,10 @@ HTMLArea.TYPO3Color = HTMLArea.Plugin.extend({
        setColor: function(button, event) {
                this.restoreSelection();
                var buttonId = this.dialog.arguments.buttonId;
-               var color = '#' + this.dialog.find('itemId', 'color')[0].getValue();
+               var color = this.dialog.find('itemId', 'color')[0].getValue();
+               if (color) {
+                       color = '#' + color;
+               }
                this.editor.focus();
                var     element,
                        fullNodeSelected = false;
@@ -371,14 +374,14 @@ HTMLArea.TYPO3Color = HTMLArea.Plugin.extend({
                        if ((element.nodeName.toLowerCase() === 'span') && !HTMLArea.hasAllowedAttributes(element, this.allowedAttributes)) {
                                this.editor.removeMarkup(element);
                        }
-               } else if (this.editor.endPointsInSameBlock()) {
+               } else if (color && this.editor.endPointsInSameBlock()) {
                        var element = this.editor._doc.createElement('span');
                                // Set the color in the style attribute
                        element.style[this.styleProperty[buttonId]] = color;
                        this.editor.wrapWithInlineElement(element, selection, range);
-                       if (!Ext.isIE) {
-                               range.detach();
-                       }
+               }
+               if (!Ext.isIE) {
+                       range.detach();
                }
                this.close();
                event.stopEvent();