[BUGFIX] handler is undefined when resizing the backend
authorOliver Hader <oliver@typo3.org>
Mon, 10 Oct 2011 22:25:31 +0000 (00:25 +0200)
committerOliver Hader <oliver@typo3.org>
Mon, 10 Oct 2011 22:37:09 +0000 (00:37 +0200)
Resizing the backend browser window results in a JavaScript error.
The function that handles the re-positioning of the menus does not
work correctly. The observer requires a reference to a callback
function - currently the method was directly executed and the return
value used as function reference, which was undefined in this case.

Change-Id: Ifb2db858d7075f4fd714d737576189c0e1efc5a5
Resolves: #30760
Related: #25787
Releases: 4.6, 4.5
Reviewed-on: http://review.typo3.org/5690
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/workspaces/Resources/Public/JavaScript/workspacemenu.js

index 5a3fa1d..5408cd4 100644 (file)
@@ -39,7 +39,10 @@ var WorkspaceMenu = Class.create({
        initialize: function() {
 
                Ext.onReady(function() {
-                       Event.observe(window, 'resize', TYPO3BackendToolbarManager.positionMenu('workspace-selector-menu'));
+                       Event.observe(
+                               window, 'resize',
+                               function() { TYPO3BackendToolbarManager.positionMenu('workspace-selector-menu'); }
+                       );
                        if (top.TYPO3.configuration.inWorkspace == 1) {
                                Ext.getBody().addClass('typo3-in-workspace');
                                this.updateTopBar(top.TYPO3.Workspaces.workspaceTitle);