[BUGFIX] handler is undefined when resizing the backend
authorSimon Schaufelberger <simonschaufi@googlemail.com>
Sat, 8 Oct 2011 16:20:48 +0000 (18:20 +0200)
committerOliver Hader <oliver@typo3.org>
Mon, 10 Oct 2011 22:37:40 +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: #25787
Releases: 4.6, 4.5
Reviewed-on: http://review.typo3.org/5634
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/js/backendsearch.js
typo3/js/clearcachemenu.js
typo3/js/shortcutmenu.js
typo3/sysext/opendocs/opendocs.js
typo3/sysext/sys_action/toolbarmenu/tx_sysactions.js

index a68bb7d..aef8331 100644 (file)
@@ -34,7 +34,10 @@ var BackendSearch = Class.create({
         */
        initialize: function() {
                Ext.onReady(function() {
-                       Event.observe(window, 'resize', TYPO3BackendToolbarManager.positionMenu('backend-search-menu'));
+                       Event.observe(
+                               window, 'resize',
+                               function() { TYPO3BackendToolbarManager.positionMenu('backend-search-menu'); }
+                       );
                        TYPO3BackendToolbarManager.positionMenu('backend-search-menu');
                        this.toolbarItemIcon = $$('#backend-search-menu .toolbar-item span.t3-icon')[0];
 
index 25b30f9..665c6f3 100644 (file)
@@ -35,7 +35,10 @@ var ClearCacheMenu = Class.create({
        initialize: function() {
 
                Ext.onReady(function() {
-                       Event.observe(window, 'resize', TYPO3BackendToolbarManager.positionMenu('clear-cache-actions-menu'));
+                       Event.observe(
+                               window, 'resize',
+                               function() { TYPO3BackendToolbarManager.positionMenu('clear-cache-actions-menu'); }
+                       );
                        TYPO3BackendToolbarManager.positionMenu('clear-cache-actions-menu');
                        this.toolbarItemIcon = $$('#clear-cache-actions-menu .toolbar-item span.t3-icon')[0];
 
index 78372c5..9d2fd5e 100644 (file)
@@ -35,7 +35,10 @@ var ShortcutMenu = Class.create({
         */
        initialize: function() {
                Ext.onReady(function() {
-                       Event.observe(window, 'resize', TYPO3BackendToolbarManager.positionMenu('shortcut-menu'));
+                       Event.observe(
+                               window, 'resize',
+                               function() { TYPO3BackendToolbarManager.positionMenu('shortcut-menu'); }
+                       );
                        TYPO3BackendToolbarManager.positionMenu('shortcut-menu');
                        
                        this.toolbarItemIcon = $$('#shortcut-menu .toolbar-item span.t3-icon')[0];
index 514a0fa..85de24e 100644 (file)
@@ -39,7 +39,10 @@ var OpenDocs = Class.create({
        initialize: function() {
 
                Ext.onReady(function() {
-                       Event.observe(window, 'resize', TYPO3BackendToolbarManager.positionMenu('tx-opendocs-menu'));
+                       Event.observe(
+                               window, 'resize',
+                               function() { TYPO3BackendToolbarManager.positionMenu('tx-opendocs-menu'); }
+                       );
                        TYPO3BackendToolbarManager.positionMenu('tx-opendocs-menu');
                        this.toolbarItemIcon = $$('#tx-opendocs-menu .toolbar-item span.t3-icon')[0];
                        this.ajaxScript      = top.TS.PATH_typo3 + this.ajaxScript; // can't be initialized earlier
index 32f7f73..6d1f384 100644 (file)
@@ -35,7 +35,10 @@ var SysActionMenu = Class.create({
        initialize: function() {
 
                Ext.onReady(function() {
-                       Event.observe(window, 'resize', TYPO3BackendToolbarManager.positionMenu('tx-sys-action-menu'));
+                       Event.observe(
+                               window, 'resize',
+                               function() { TYPO3BackendToolbarManager.positionMenu('tx-sys-action-menu'); }
+                       );
                        TYPO3BackendToolbarManager.positionMenu('tx-sys-action-menu');
                        this.toolbarItemIcon = $$('#tx-sys-action-menu .toolbar-item span')[0].src;