[BUGFIX] Fix JS error with Context Sensitive Help 48/21548/2
authorMichel Nederlof <m.nederlof@drecomm.nl>
Wed, 19 Jun 2013 21:47:02 +0000 (23:47 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 20 Jun 2013 18:33:24 +0000 (20:33 +0200)
Using the edit form for records in a new pop window leads
to a JS error, as "top" is not defined in the new window.

Resolves: #26588
Releases: 6.2, 6.1, 6.0, 4.7, 4.5
Change-Id: I2eab83a2c9df2fed13fd5bcc1c829bf4f2b9a055
Reviewed-on: https://review.typo3.org/21548
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
t3lib/js/extjs/contexthelp.js

index 6ff8c8f..5ae9e37 100644 (file)
@@ -60,9 +60,16 @@ TYPO3.ContextHelp = function() {
                } else {
                                // If a table is defined, use ExtDirect call to get the tooltip's content
                        if (table) {
+                               var description = '';
+                               if (typeof(top.TYPO3.LLL) !== 'undefined') {
+                                       description = top.TYPO3.LLL.core.csh_tooltip_loading;
+                               } else if (opener && typeof(opener.top.TYPO3.LLL) !== 'undefined') {
+                                       description = opener.top.TYPO3.LLL.core.csh_tooltip_loading;
+                               }
+
                                        // Clear old tooltip contents
                                updateTip({
-                                       description: top.TYPO3.LLL.core.csh_tooltip_loading,
+                                       description: description,
                                        cshLink: '',
                                        moreInfo: '',
                                        title: ''