Bug #23109 » 15014_v2.diff
typo3/js/workspacemenu.js 2010-07-29 16:46:40.000000000 +0200 | ||
---|---|---|
* toggles the workspace frontend preview
|
||
*/
|
||
toggleFrontendPreview: function(event) {
|
||
var clickedElement = Event.element(event);
|
||
var toggle = new Ajax.Request('ajax.php', {
|
||
parameters: 'ajaxID=WorkspaceMenu::toggleWorkspacePreview',
|
||
onSuccess: function(transport, response) {
|
||
... | ... | |
if (response.newWorkspacePreviewState === '1') {
|
||
TYPO3.configuration.workspaceFrontendPreviewEnabled = 1;
|
||
Event.element(event).previous().removeClassName(stateInactiveClass).addClassName(stateActiveClass);
|
||
clickedElement.previous().removeClassName(stateInactiveClass).addClassName(stateActiveClass);
|
||
top.WorkspaceFrontendPreviewEnabled = true;
|
||
} else {
|
||
TYPO3.configuration.workspaceFrontendPreviewEnabled = 0;
|
||
Event.element(event).previous().removeClassName(stateActiveClass).addClassName(stateInactiveClass);
|
||
clickedElement.previous().removeClassName(stateActiveClass).addClassName(stateInactiveClass);
|
||
top.WorkspaceFrontendPreviewEnabled = false;
|
||
}
|
||
}
|
||
... | ... | |
* switches the workspace, reloads the module menu, and the content frame
|
||
*/
|
||
switchWorkspace: function(event) {
|
||
var workspaceId = Event.element(event).identify().substring(3);
|
||
var clickedElement = Event.element(event);
|
||
var workspaceId = clickedElement.identify().substring(3);
|
||
var switchRequest = new Ajax.Request('ajax.php', {
|
||
parameters: 'ajaxID=WorkspaceMenu::setWorkspace&workspaceId=' + workspaceId,
|
||
... | ... | |
$$('#workspace-selector-menu li.selected')[0].removeClassName('selected');
|
||
// add "selected" class and checkmark
|
||
Event.element(event).previous().removeClassName(stateInactiveClass).addClassName(stateActiveClass);
|
||
Event.element(event).up().addClassName('selected');
|
||
clickedElement.previous().removeClassName(stateInactiveClass).addClassName(stateActiveClass);
|
||
clickedElement.up().addClassName('selected');
|
||
// when in web module reload, otherwise send the user to the web module
|
||
if (currentModuleLoaded.startsWith('web_')) {
|