Fixed bug #14464: htmlArea RTE: Type of block accumulation if the block is manually...
authorStanislas Rolland <typo3@sjbr.ca>
Sat, 19 Jun 2010 14:19:13 +0000 (14:19 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Sat, 19 Jun 2010 14:19:13 +0000 (14:19 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7966 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockElements/block-elements.js

index 1819c08..9fa6d81 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-06-19  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #14464: htmlArea RTE: Type of block accumulation if the block is manually selected in Safari
+
 2010-06-19  Benjamin Mack  <benni@typo3.org>
 
        * Fixed bug #14593: Link wizard tabs have no style / Followup to #14733 (On behalf of Stanislas Rolland)
index 3d6110c..76100f1 100644 (file)
@@ -1,3 +1,7 @@
+2010-06-19  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #14464: htmlArea RTE: Type of block accumulation if the block is manually selected in Safari
+
 2010-06-18  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Updated htmlArea RTE version to 2.0.1
index 2e95735..0971af7 100644 (file)
@@ -267,8 +267,12 @@ HTMLArea.BlockElements = HTMLArea.Plugin.extend({
                                                element = "<" + element + ">";
                                        }
                                        this.editor.focus();
-                                       if (Ext.isWebKit && !this.editor._doc.body.hasChildNodes()) {
-                                               this.editor._doc.body.appendChild((this.editor._doc.createElement("br")));
+                                       if (Ext.isWebKit) {
+                                               if (!this.editor._doc.body.hasChildNodes()) {
+                                                       this.editor._doc.body.appendChild((this.editor._doc.createElement("br")));
+                                               }
+                                                       // WebKit sometimes leaves empty block at the end of the selection
+                                               this.editor._doc.body.normalize();
                                        }
                                        try {
                                                this.editor._doc.execCommand(buttonId, false, element);