[BUGFIX] JavaScript error on page load - TYPO3.LLL.Workspace is undefined
[Packages/TYPO3.CMS.git] / typo3 / sysext / workspaces / Classes / Controller / PreviewController.php
index 2acd211..3771226 100644 (file)
@@ -63,7 +63,6 @@ class Tx_Workspaces_Controller_PreviewController extends Tx_Workspaces_Controlle
                $this->pageRenderer->addJsFile($this->backPath . 'js/extjs/iframepanel.js');
 
                $this->pageRenderer->addJsFile($resourcePath . 'JavaScript/Ext.ux.plugins.TabStripContainer.js');
                $this->pageRenderer->addJsFile($this->backPath . 'js/extjs/iframepanel.js');
 
                $this->pageRenderer->addJsFile($resourcePath . 'JavaScript/Ext.ux.plugins.TabStripContainer.js');
-               $this->pageRenderer->addJsFile($resourcePath . 'JavaScript/preview.js');
 
                        // todo this part should be done with inlineLocallanglabels
                $this->pageRenderer->addJsInlineCode('workspace-inline-code', $this->generateJavascript());
 
                        // todo this part should be done with inlineLocallanglabels
                $this->pageRenderer->addJsInlineCode('workspace-inline-code', $this->generateJavascript());
@@ -117,6 +116,9 @@ class Tx_Workspaces_Controller_PreviewController extends Tx_Workspaces_Controlle
                        modeVbox: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.modeVbox', TRUE) . "',
                        modeHbox: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.modeHbox', TRUE) . "'
                };\n");
                        modeVbox: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.modeVbox', TRUE) . "',
                        modeHbox: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.modeHbox', TRUE) . "'
                };\n");
+
+               $resourcePath = t3lib_extMgm::extRelPath('workspaces') . 'Resources/Public/';
+               $this->pageRenderer->addJsFile($resourcePath . 'JavaScript/preview.js');
        }
 
        /**
        }
 
        /**