Bug #24694 ยป forge12000.diff
typo3/js/backendsearch.js (Arbeitskopie) | ||
---|---|---|
* registers for resize event listener and executes on DOM ready
|
||
*/
|
||
initialize: function() {
|
||
Event.observe(window, 'resize', this.positionMenu);
|
||
Ext.onReady(function() {
|
||
this.positionMenu();
|
||
Event.observe(window, 'resize', TYPO3BackendToolbarManager.positionMenu('backend-search-menu'));
|
||
TYPO3BackendToolbarManager.positionMenu('backend-search-menu');
|
||
this.toolbarItemIcon = $$('#backend-search-menu .toolbar-item span.t3-icon')[0];
|
||
$('search-query').observe('keypress', function(event) {
|
||
... | ... | |
}.bindAsEventListener(this));
|
||
},
|
||
/**
|
||
* positions the menu below the toolbar icon, let's do some math!
|
||
*/
|
||
positionMenu: function() {
|
||
var calculatedOffset = 0;
|
||
var parentWidth = $('backend-search-menu').getWidth();
|
||
var currentToolbarItemLayer = $$('#backend-search-menu div')[0];
|
||
var ownWidth = currentToolbarItemLayer.getWidth();
|
||
var parentSiblings = $('backend-search-menu').previousSiblings();
|
||
parentSiblings.each(function(toolbarItem) {
|
||
calculatedOffset += toolbarItem.getWidth() - 1;
|
||
// -1 to compensate for the margin-right -1px of the list items,
|
||
// which itself is necessary for overlaying the separator with the active state background
|
||
if (toolbarItem.down().hasClassName('no-separator')) {
|
||
calculatedOffset -= 1;
|
||
}
|
||
});
|
||
calculatedOffset = calculatedOffset - ownWidth + parentWidth;
|
||
// border correction
|
||
if (currentToolbarItemLayer.getStyle('display') !== 'none') {
|
||
calculatedOffset += 2;
|
||
}
|
||
$$('#backend-search-menu div')[0].setStyle({
|
||
left: calculatedOffset + 'px'
|
||
});
|
||
},
|
||
/**
|
||
* toggles the visibility of the menu and places it under the toolbar icon
|
||
*/
|
typo3/js/workspacemenu.js (Arbeitskopie) | ||
---|---|---|
* registers for resize event listener and executes on DOM ready
|
||
*/
|
||
initialize: function() {
|
||
Event.observe(window, 'resize', this.positionMenu);
|
||
Ext.onReady(function() {
|
||
this.positionMenu();
|
||
Event.observe(window, 'resize', TYPO3BackendToolbarManager.positionMenu('workspace-selector-menu'));
|
||
TYPO3BackendToolbarManager.positionMenu('workspace-selector-menu');
|
||
Event.observe('workspace-selector-menu', 'click', this.toggleMenu);
|
||
Event.observe('frontendPreviewToggle', 'click', this.toggleFrontendPreview.bind(this));
|
||
... | ... | |
},
|
||
/**
|
||
* positions the menu below the toolbar icon, let's do some math!
|
||
*/
|
||
positionMenu: function() {
|
||
var calculatedOffset = 0;
|
||
var parentWidth = $('workspace-selector-menu').getWidth();
|
||
var currentToolbarItemLayer = $$('#workspace-selector-menu ul')[0];
|
||
var ownWidth = currentToolbarItemLayer.getWidth();
|
||
var parentSiblings = $('workspace-selector-menu').previousSiblings();
|
||
parentSiblings.each(function(toolbarItem) {
|
||
calculatedOffset += toolbarItem.getWidth() - 1;
|
||
// -1 to compensate for the margin-right -1px of the list items,
|
||
// which itself is necessary for overlaying the separator with the active state background
|
||
if (toolbarItem.down().hasClassName('no-separator')) {
|
||
calculatedOffset -= 1;
|
||
}
|
||
});
|
||
calculatedOffset = calculatedOffset - ownWidth + parentWidth;
|
||
// border correction
|
||
if (currentToolbarItemLayer.getStyle('display') !== 'none') {
|
||
calculatedOffset += 2;
|
||
}
|
||
$$('#workspace-selector-menu ul')[0].setStyle({
|
||
left: calculatedOffset + 'px'
|
||
});
|
||
},
|
||
/**
|
||
* toggles the visibility of the menu and places it under the toolbar icon
|
||
*/
|
||
toggleMenu: function(event) {
|
typo3/js/toolbarmanager.js (Arbeitskopie) | ||
---|---|---|
// show toolbarItem
|
||
toolbarItem.addClassName('toolbar-item-active');
|
||
}
|
||
},
|
||
/**
|
||
* refreshs positioning of all submenus
|
||
*/
|
||
refreshAll: function() {
|
||
$$('.toolbar-item-menu').each(function(element) {
|
||
menuParent = Ext.get(element);
|
||
TYPO3BackendToolbarManager.positionMenu(menuParent.findParentNode('[id$="-menu"]').id);
|
||
});
|
||
},
|
||
/**
|
||
* positions a toolbar item (has to have .toolbar-item-menu)
|
||
* @param elementId The parent element ofthe menu to be positioned
|
||
*/
|
||
positionMenu: function(elementId) {
|
||
var calculatedOffset = 0;
|
||
var parentWidth = $(elementId).getWidth();
|
||
var currentToolbarItemLayer = $$('#' + elementId + ' .toolbar-item-menu')[0];
|
||
var ownWidth = currentToolbarItemLayer.getWidth();
|
||
var parentSiblings = $(elementId).previousSiblings();
|
||
parentSiblings.each(function(toolbarItem) {
|
||
calculatedOffset += toolbarItem.getWidth() - 1;
|
||
// -1 to compensate for the margin-right -1px of the list items,
|
||
// which itself is necessary for overlaying the separator with the active state background
|
||
if (toolbarItem.down().hasClassName('no-separator')) {
|
||
calculatedOffset -= 1;
|
||
}
|
||
});
|
||
calculatedOffset = calculatedOffset - ownWidth + parentWidth;
|
||
// border correction
|
||
if (currentToolbarItemLayer.getStyle('display') !== 'none') {
|
||
calculatedOffset += 2;
|
||
}
|
||
$$('#' + elementId + ' .toolbar-item-menu')[0].setStyle({
|
||
left: calculatedOffset + 'px'
|
||
});
|
||
}
|
||
});
|
typo3/js/clearcachemenu.js (Arbeitskopie) | ||
---|---|---|
* registers for resize event listener and executes on DOM ready
|
||
*/
|
||
initialize: function() {
|
||
Event.observe(window, 'resize', this.positionMenu);
|
||
Ext.onReady(function() {
|
||
this.positionMenu();
|
||
Event.observe(window, 'resize', TYPO3BackendToolbarManager.positionMenu('clear-cache-actions-menu'));
|
||
TYPO3BackendToolbarManager.positionMenu('clear-cache-actions-menu');
|
||
this.toolbarItemIcon = $$('#clear-cache-actions-menu .toolbar-item span.t3-icon')[0];
|
||
Event.observe('clear-cache-actions-menu', 'click', this.toggleMenu)
|
||
... | ... | |
},
|
||
/**
|
||
* positions the menu below the toolbar icon, let's do some math!
|
||
*/
|
||
positionMenu: function() {
|
||
var calculatedOffset = 0;
|
||
var parentWidth = $('clear-cache-actions-menu').getWidth();
|
||
var currentToolbarItemLayer = $$('#clear-cache-actions-menu ul')[0];
|
||
var ownWidth = currentToolbarItemLayer.getWidth();
|
||
var parentSiblings = $('clear-cache-actions-menu').previousSiblings();
|
||
parentSiblings.each(function(toolbarItem) {
|
||
calculatedOffset += toolbarItem.getWidth() - 1;
|
||
// -1 to compensate for the margin-right -1px of the list items,
|
||
// which itself is necessary for overlaying the separator with the active state background
|
||
if (toolbarItem.down().hasClassName('no-separator')) {
|
||
calculatedOffset -= 1;
|
||
}
|
||
});
|
||
calculatedOffset = calculatedOffset - ownWidth + parentWidth;
|
||
// border correction
|
||
if (currentToolbarItemLayer.getStyle('display') !== 'none') {
|
||
calculatedOffset += 2;
|
||
}
|
||
$$('#clear-cache-actions-menu ul')[0].setStyle({
|
||
left: calculatedOffset + 'px'
|
||
});
|
||
},
|
||
/**
|
||
* toggles the visibility of the menu and places it under the toolbar icon
|
||
*/
|
||
toggleMenu: function(event) {
|
typo3/js/shortcutmenu.js (Arbeitskopie) | ||
---|---|---|
* registers for resize event listener and executes on DOM ready
|
||
*/
|
||
initialize: function() {
|
||
Event.observe(window, 'resize', this.positionMenu);
|
||
Ext.onReady(function() {
|
||
this.positionMenu();
|
||
Event.observe(window, 'resize', TYPO3BackendToolbarManager.positionMenu('shortcut-menu'));
|
||
TYPO3BackendToolbarManager.positionMenu('shortcut-menu');
|
||
|
||
this.toolbarItemIcon = $$('#shortcut-menu .toolbar-item span.t3-icon')[0];
|
||
Event.observe($$('#shortcut-menu .toolbar-item')[0], 'click', this.toggleMenu);
|
||
... | ... | |
},
|
||
/**
|
||
* positions the menu below the toolbar icon, let's do some math!
|
||
*/
|
||
positionMenu: function() {
|
||
var calculatedOffset = 0;
|
||
var parentWidth = $('shortcut-menu').getWidth();
|
||
var currentToolbarItemLayer = $$('#shortcut-menu .toolbar-item-menu')[0];
|
||
var ownWidth = currentToolbarItemLayer.getWidth();
|
||
var parentSiblings = $('shortcut-menu').previousSiblings();
|
||
parentSiblings.each(function(toolbarItem) {
|
||
calculatedOffset += toolbarItem.getWidth() - 1;
|
||
// -1 to compensate for the margin-right -1px of the list items,
|
||
// which itself is necessary for overlaying the separator with the active state background
|
||
if (toolbarItem.down().hasClassName('no-separator')) {
|
||
calculatedOffset -= 1;
|
||
}
|
||
});
|
||
calculatedOffset = calculatedOffset - ownWidth + parentWidth;
|
||
// border correction
|
||
if (currentToolbarItemLayer.getStyle('display') !== 'none') {
|
||
calculatedOffset += 2;
|
||
}
|
||
$$('#shortcut-menu .toolbar-item-menu')[0].setStyle({
|
||
left: calculatedOffset + 'px'
|
||
});
|
||
},
|
||
/**
|
||
* toggles the visibility of the menu and places it under the toolbar icon
|
||
*/
|
||
toggleMenu: function(event) {
|
typo3/sysext/opendocs/opendocs.js (Arbeitskopie) | ||
---|---|---|
* registers for resize event listener and executes on DOM ready
|
||
*/
|
||
initialize: function() {
|
||
Event.observe(window, 'resize', this.positionMenu);
|
||
Ext.onReady(function() {
|
||
this.positionMenu();
|
||
Event.observe(window, 'resize', 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
|
||
... | ... | |
},
|
||
/**
|
||
* positions the menu below the toolbar icon, let's do some math!
|
||
*/
|
||
positionMenu: function() {
|
||
var calculatedOffset = 0;
|
||
var parentWidth = $('tx-opendocs-menu').getWidth();
|
||
var currentToolbarItemLayer = $$('#tx-opendocs-menu .toolbar-item-menu')[0];
|
||
var ownWidth = currentToolbarItemLayer.getWidth();
|
||
var parentSiblings = $('tx-opendocs-menu').previousSiblings();
|
||
parentSiblings.each(function(toolbarItem) {
|
||
calculatedOffset += toolbarItem.getWidth() - 1;
|
||
// -1 to compensate for the margin-right -1px of the list items,
|
||
// which itself is necessary for overlaying the separator with the active state background
|
||
if(toolbarItem.down().hasClassName('no-separator')) {
|
||
calculatedOffset -= 1;
|
||
}
|
||
});
|
||
calculatedOffset = calculatedOffset - ownWidth + parentWidth;
|
||
// border correction
|
||
if (currentToolbarItemLayer.getStyle('display') !== 'none') {
|
||
calculatedOffset += 2;
|
||
}
|
||
$$('#tx-opendocs-menu .toolbar-item-menu')[0].setStyle({
|
||
left: calculatedOffset + 'px'
|
||
});
|
||
},
|
||
/**
|
||
* toggles the visibility of the menu and places it under the toolbar icon
|
||
*/
|
||
toggleMenu: function(event) {
|
typo3/sysext/sys_action/toolbarmenu/tx_sysactions.js (Arbeitskopie) | ||
---|---|---|
* registers for resize event listener and executes on DOM ready
|
||
*/
|
||
initialize: function() {
|
||
Event.observe(window, 'resize', this.positionMenu);
|
||
Ext.onReady(function() {
|
||
this.positionMenu();
|
||
Event.observe(window, 'resize', TYPO3BackendToolbarManager.positionMenu('tx-sys-action-menu'));
|
||
TYPO3BackendToolbarManager.positionMenu('tx-sys-action-menu');
|
||
this.toolbarItemIcon = $$('#tx-sys-action-menu .toolbar-item span')[0].src;
|
||
Event.observe('tx-sys-action-menu', 'click', this.toggleMenu);
|
||
... | ... | |
},
|
||
/**
|
||
* positions the menu below the toolbar icon, let's do some math!
|
||
*/
|
||
positionMenu: function() {
|
||
var calculatedOffset = 0;
|
||
var parentWidth = $('tx-sys-action-menu').getWidth();
|
||
var currentToolbarItemLayer = $$('#tx-sys-action-menu ul')[0];
|
||
var ownWidth = currentToolbarItemLayer.getWidth();
|
||
var parentSiblings = $('tx-sys-action-menu').previousSiblings();
|
||
parentSiblings.each(function(toolbarItem) {
|
||
calculatedOffset += toolbarItem.getWidth() - 1;
|
||
// -1 to compensate for the margin-right -1px of the list items,
|
||
// which itself is necessary for overlaying the separator with the active state background
|
||
if(toolbarItem.down().hasClassName('no-separator')) {
|
||
calculatedOffset -= 1;
|
||
}
|
||
});
|
||
calculatedOffset = calculatedOffset - ownWidth + parentWidth;
|
||
// border correction
|
||
if (currentToolbarItemLayer.getStyle('display') !== 'none') {
|
||
calculatedOffset += 2;
|
||
}
|
||
$$('#tx-sys-action-menu ul')[0].setStyle({
|
||
left: calculatedOffset + 'px'
|
||
});
|
||
},
|
||
/**
|
||
* toggles the visibility of the menu and places it under the toolbar icon
|
||
*/
|
||
toggleMenu: function(event) {
|