* Fixed bug #7687: htmlArea RTE context menu may produce js error
authorStanislas Rolland <typo3@sjbr.ca>
Tue, 26 Feb 2008 22:27:44 +0000 (22:27 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Tue, 26 Feb 2008 22:27:44 +0000 (22:27 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3305 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/htmlarea/plugins/ContextMenu/context-menu.js

index 8b5ac3d..6f3f26b 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,7 @@
 
        * Added feature #7667: htmlArea RTE: Usability improvements in table operations
        * Fixed bug #7671: htmlArea RTE configuration variable "Add default User TSonfig RTE configuration" not working. Thanks to Jan Persson.
+       * Fixed bug #7687: htmlArea RTE context menu may produce js error
 
 2008-02-25  Ernesto Baschny  <ernst@cron-it.de>
 
index 9664d25..2e265b0 100644 (file)
@@ -2,6 +2,7 @@
 
        * Added feature #7667: htmlArea RTE: Usability improvements in table operations
        * Fixed bug #7671: htmlArea RTE configuration variable "Add default User TSonfig RTE configuration" not working. Thanks to Jan Persson.
+       * Fixed bug #7687: htmlArea RTE context menu may produce js error
 
 2008-02-20  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
 
index 239e550..75114d2 100644 (file)
@@ -234,7 +234,7 @@ ContextMenu.prototype.getContextMenu = function(target) {
                table = null, tr = null, td = null, img = null, list = null, div = null;
        
        for(; target; target = target.parentNode) {
-               tag = target.tagName;
+               tag = target.nodeName;
                if(!tag) continue;
                tag = tag.toLowerCase();
                switch (tag) {
@@ -315,8 +315,8 @@ ContextMenu.prototype.getContextMenu = function(target) {
                        btnList["CreateLink"][1],"CreateLink"]);
        }
        
-       if (!/html|body/i.test(currentTarget.tagName)) {
-               if (/table|thead|tbody|tr|td|th|tfoot/i.test(currentTarget.tagName)) {
+       if (!/^(html|body)$/i.test(currentTarget.nodeName)) {
+               if (/^(table|thead|tbody|tr|td|th|tfoot)$/i.test(currentTarget.nodeName)) {
                        tmp = table;
                        table = null;
                } else if(list) {