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

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

index 3c4ce0c..0fcfec2 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-10  Dmitry Dulepov  <dmitry.dulepov@gmail.com>
 
        * Fixed bug #5117: typolink: cHash corrupted due to linkVars (together with Pierre Dudoret (Popy))
index f979bed..0462a90 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-04-08  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Updated htmlArea RTE version to 1.7.15
index 7abc2de..6bd00b6 100644 (file)
@@ -218,8 +218,12 @@ BlockElements = HTMLArea.Plugin.extend({
                                        element = "<" + element + ">";
                                }
                                this.editor.focusEditor();
-                               if (HTMLArea.is_safari && !this.editor._doc.body.hasChildNodes()) {
-                                       this.editor._doc.body.appendChild((this.editor._doc.createElement("br")));
+                               if (HTMLArea.is_safari) {
+                                       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);