diff --git a/ChangeLog b/ChangeLog index b562e636e96f38cfcaaa169b7836cd57f183ad7a..71978d7286b3078dd6a9eb3be8b74d160f26e93d 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-05-03 Steffen Kamper <info@sk-typo3.de> + + * Fixed bug #14144: Positioning of toolbar elements broken, especially in Safari (thanks to Stefan Galinski) + 2010-05-03 Xavier Perseguers <typo3@perseguers.ch> * Raised DBAL version from 1.1.4 to 1.1.5 diff --git a/typo3/js/backendsearch.js b/typo3/js/backendsearch.js index 4a173a2756ca15498cb5faea2c40c870c9f779d8..66afcf7efbec01ee6bbe7bd1ddad38b2e1815ec5 100644 --- a/typo3/js/backendsearch.js +++ b/typo3/js/backendsearch.js @@ -37,7 +37,7 @@ var BackendSearch = Class.create({ initialize: function() { Event.observe(window, 'resize', this.positionMenu); - Event.observe(window, 'load', function(){ + Ext.onReady(function() { this.positionMenu(); this.toolbarItemIcon = $$('#backend-search-menu .toolbar-item img')[0].src; @@ -57,7 +57,7 @@ var BackendSearch = Class.create({ if(keyCode == Event.KEY_RETURN) { this.invokeSearch(); } - }.bindAsEventListener(this)); + }, this); $$('#backend-search-menu .toolbar-item')[0].observe('click', this.toggleMenu) }.bindAsEventListener(this)); @@ -69,7 +69,9 @@ var BackendSearch = Class.create({ positionMenu: function() { var calculatedOffset = 0; var parentWidth = $('backend-search-menu').getWidth(); - var ownWidth = $$('#backend-search-menu div')[0].getWidth(); + var currentToolbarItemLayer = $$('#backend-search-menu div')[0]; + var ownWidth = currentToolbarItemLayer.getWidth(); + var parentSiblings = $('backend-search-menu').previousSiblings(); parentSiblings.each(function(toolbarItem) { @@ -83,6 +85,10 @@ var BackendSearch = Class.create({ }); calculatedOffset = calculatedOffset - ownWidth + parentWidth; + // border correction + if (currentToolbarItemLayer.getStyle('display') !== 'none') { + calculatedOffset += 2; + } $$('#backend-search-menu div')[0].setStyle({ left: calculatedOffset + 'px' @@ -134,7 +140,7 @@ var BackendSearch = Class.create({ top.loadEditId(jsonResponse.editRecord); break; case 'alternative': - this.jump( + this.jump( unescape('alt_doc.php?returnUrl=dummy.php&edit[' + jsonResponse.alternativeTable + '][' + jsonResponse.alternativeUid + ']=edit'), 'web_list', 'web' diff --git a/typo3/js/clearcachemenu.js b/typo3/js/clearcachemenu.js index 0f8696f5413e9b4b6643e82101939c9e87258c61..494f377e9be1639414060f4e54fa228cc939d606 100644 --- a/typo3/js/clearcachemenu.js +++ b/typo3/js/clearcachemenu.js @@ -37,7 +37,7 @@ var ClearCacheMenu = Class.create({ initialize: function() { Event.observe(window, 'resize', this.positionMenu); - Event.observe(window, 'load', function(){ + Ext.onReady(function() { this.positionMenu(); this.toolbarItemIcon = $$('#clear-cache-actions-menu .toolbar-item img')[0].src; @@ -47,7 +47,7 @@ var ClearCacheMenu = Class.create({ $$('#clear-cache-actions-menu li a').each(function(element) { Event.observe(element, 'click', this.clearCache.bind(this)); }.bindAsEventListener(this)); - }.bindAsEventListener(this)); + }, this); }, /** @@ -56,7 +56,8 @@ var ClearCacheMenu = Class.create({ positionMenu: function() { var calculatedOffset = 0; var parentWidth = $('clear-cache-actions-menu').getWidth(); - var ownWidth = $$('#clear-cache-actions-menu ul')[0].getWidth(); + var currentToolbarItemLayer = $$('#clear-cache-actions-menu ul')[0]; + var ownWidth = currentToolbarItemLayer.getWidth(); var parentSiblings = $('clear-cache-actions-menu').previousSiblings(); parentSiblings.each(function(toolbarItem) { @@ -70,6 +71,11 @@ var ClearCacheMenu = Class.create({ }); calculatedOffset = calculatedOffset - ownWidth + parentWidth; + // border correction + if (currentToolbarItemLayer.getStyle('display') !== 'none') { + calculatedOffset += 2; + } + $$('#clear-cache-actions-menu ul')[0].setStyle({ left: calculatedOffset + 'px' diff --git a/typo3/js/shortcutmenu.js b/typo3/js/shortcutmenu.js index 975ade16edf2130a7b1efc27a63b10054aca0211..9b43fb7d5686e21887a192b3dc70739fb6b07d81 100644 --- a/typo3/js/shortcutmenu.js +++ b/typo3/js/shortcutmenu.js @@ -38,13 +38,13 @@ var ShortcutMenu = Class.create({ initialize: function() { Event.observe(window, 'resize', this.positionMenu); - Event.observe(window, 'load', function(){ + Ext.onReady(function() { this.positionMenu(); this.toolbarItemIcon = $$('#shortcut-menu .toolbar-item img')[0].src; Event.observe($$('#shortcut-menu .toolbar-item')[0], 'click', this.toggleMenu); this.initControls(); - }.bindAsEventListener(this)); + }, this); }, /** @@ -107,7 +107,8 @@ var ShortcutMenu = Class.create({ positionMenu: function() { var calculatedOffset = 0; var parentWidth = $('shortcut-menu').getWidth(); - var ownWidth = $$('#shortcut-menu .toolbar-item-menu')[0].getWidth(); + var currentToolbarItemLayer = $$('#shortcut-menu .toolbar-item-menu')[0]; + var ownWidth = currentToolbarItemLayer.getWidth(); var parentSiblings = $('shortcut-menu').previousSiblings(); parentSiblings.each(function(toolbarItem) { @@ -121,6 +122,10 @@ var ShortcutMenu = Class.create({ }); calculatedOffset = calculatedOffset - ownWidth + parentWidth; + // border correction + if (currentToolbarItemLayer.getStyle('display') !== 'none') { + calculatedOffset += 2; + } $$('#shortcut-menu .toolbar-item-menu')[0].setStyle({ left: calculatedOffset + 'px' diff --git a/typo3/js/workspacemenu.js b/typo3/js/workspacemenu.js index f143001b53222900c7e3ca5da3e77c65d8f637d4..ef5e5e98d104aefef3d646a1f87b65c57f35c584 100644 --- a/typo3/js/workspacemenu.js +++ b/typo3/js/workspacemenu.js @@ -38,7 +38,7 @@ var WorkspaceMenu = Class.create({ initialize: function() { Event.observe(window, 'resize', this.positionMenu); - Event.observe(window, 'load', function(){ + Ext.onReady(function() { this.positionMenu(); Event.observe('workspace-selector-menu', 'click', this.toggleMenu); @@ -50,7 +50,7 @@ var WorkspaceMenu = Class.create({ Event.observe(element, 'click', this.switchWorkspace.bind(this)); }.bindAsEventListener(this)); - }.bindAsEventListener(this)); + }, this); }, /** @@ -59,7 +59,8 @@ var WorkspaceMenu = Class.create({ positionMenu: function() { var calculatedOffset = 0; var parentWidth = $('workspace-selector-menu').getWidth(); - var ownWidth = $$('#workspace-selector-menu ul')[0].getWidth(); + var currentToolbarItemLayer = $$('#workspace-selector-menu ul')[0]; + var ownWidth = currentToolbarItemLayer.getWidth(); var parentSiblings = $('workspace-selector-menu').previousSiblings(); parentSiblings.each(function(toolbarItem) { @@ -73,6 +74,10 @@ var WorkspaceMenu = Class.create({ }); calculatedOffset = calculatedOffset - ownWidth + parentWidth; + // border correction + if (currentToolbarItemLayer.getStyle('display') !== 'none') { + calculatedOffset += 2; + } $$('#workspace-selector-menu ul')[0].setStyle({ left: calculatedOffset + 'px' @@ -145,7 +150,7 @@ var WorkspaceMenu = Class.create({ parameters: 'ajaxID=WorkspaceMenu::setWorkspace&workspaceId=' + workspaceId, onSuccess: function(transport, response) { TYPO3.configuration.inWorkspace = response.setWorkspaceId === 0 ? 0 : 1; - + // first remove all checks, then set the check in front of the selected workspace var stateActiveIcon = $$('#workspace-selector-menu img.state-active')[0].cloneNode(true); var stateInactiveIcon = $$('#workspace-selector-menu img.state-inactive')[0].cloneNode(true); diff --git a/typo3/sysext/opendocs/opendocs.js b/typo3/sysext/opendocs/opendocs.js index 34b5d6c71f0e0f4e2e094befa973603b8ae8c6eb..12bda0317eb886db6d1187d7cb4905d011cbc0f5 100644 --- a/typo3/sysext/opendocs/opendocs.js +++ b/typo3/sysext/opendocs/opendocs.js @@ -39,7 +39,7 @@ var OpenDocs = Class.create({ initialize: function() { Event.observe(window, 'resize', this.positionMenu); - Event.observe(window, 'load', function(){ + Ext.onReady(function() { this.positionMenu(); this.toolbarItemIcon = $$('#tx-opendocs-menu .toolbar-item img')[0].src; this.ajaxScript = top.TS.PATH_typo3 + this.ajaxScript; // can't be initialized earlier @@ -47,7 +47,7 @@ var OpenDocs = Class.create({ Event.observe($$('#tx-opendocs-menu .toolbar-item')[0], 'click', this.toggleMenu); this.menu = $$('#tx-opendocs-menu .toolbar-item-menu')[0]; this.toolbarItemIcon = $$('#shortcut-menu .toolbar-item img')[0].src; - }.bindAsEventListener(this)); + }, this); }, /** @@ -56,7 +56,8 @@ var OpenDocs = Class.create({ positionMenu: function() { var calculatedOffset = 0; var parentWidth = $('tx-opendocs-menu').getWidth(); - var ownWidth = $$('#tx-opendocs-menu .toolbar-item-menu')[0].getWidth(); + var currentToolbarItemLayer = $$('#tx-opendocs-menu .toolbar-item-menu')[0]; + var ownWidth = currentToolbarItemLayer.getWidth(); var parentSiblings = $('tx-opendocs-menu').previousSiblings(); parentSiblings.each(function(toolbarItem) { @@ -70,6 +71,10 @@ var OpenDocs = Class.create({ }); calculatedOffset = calculatedOffset - ownWidth + parentWidth; + // border correction + if (currentToolbarItemLayer.getStyle('display') !== 'none') { + calculatedOffset += 2; + } $$('#tx-opendocs-menu .toolbar-item-menu')[0].setStyle({ left: calculatedOffset + 'px' @@ -162,4 +167,3 @@ var OpenDocs = Class.create({ }); var TYPO3BackendOpenDocs = new OpenDocs(); - diff --git a/typo3/sysext/sys_action/toolbarmenu/tx_sysactions.js b/typo3/sysext/sys_action/toolbarmenu/tx_sysactions.js index 78b19c55d365ae4e0b289c8fb8eb1ba0d028714f..b6451009aace9f8e397ca830bb218dd8b3690f6b 100644 --- a/typo3/sysext/sys_action/toolbarmenu/tx_sysactions.js +++ b/typo3/sysext/sys_action/toolbarmenu/tx_sysactions.js @@ -37,13 +37,13 @@ var SysActionMenu = Class.create({ initialize: function() { Event.observe(window, 'resize', this.positionMenu); - Event.observe(window, 'load', function(){ + Ext.onReady(function() { this.positionMenu(); this.toolbarItemIcon = $$('#tx-sys-action-menu .toolbar-item img')[0].src; Event.observe('tx-sys-action-menu', 'click', this.toggleMenu); - }.bindAsEventListener(this)); + }, this); }, /** @@ -52,7 +52,8 @@ var SysActionMenu = Class.create({ positionMenu: function() { var calculatedOffset = 0; var parentWidth = $('tx-sys-action-menu').getWidth(); - var ownWidth = $$('#tx-sys-action-menu ul')[0].getWidth(); + var currentToolbarItemLayer = $$('#tx-sys-action-menu ul')[0]; + var ownWidth = currentToolbarItemLayer.getWidth(); var parentSiblings = $('tx-sys-action-menu').previousSiblings(); parentSiblings.each(function(toolbarItem) { @@ -66,6 +67,10 @@ var SysActionMenu = Class.create({ }); calculatedOffset = calculatedOffset - ownWidth + parentWidth; + // border correction + if (currentToolbarItemLayer.getStyle('display') !== 'none') { + calculatedOffset += 2; + } $$('#tx-sys-action-menu ul')[0].setStyle({ left: calculatedOffset + 'px' @@ -97,4 +102,3 @@ var SysActionMenu = Class.create({ }); var TYPO3BackendSysactionMenu = new SysActionMenu(); -