Fixed bug #14525: Workspacemenu JS is broken
authorSteffen Kamper <info@sk-typo3.de>
Sun, 30 May 2010 17:32:12 +0000 (17:32 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Sun, 30 May 2010 17:32:12 +0000 (17:32 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7760 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/classes/class.workspaceselector.php
typo3/js/workspacemenu.js

index 25eee0d..2ac7b99 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-05-30  Steffen Kamper  <info@sk-typo3.de>
 
+       * Fixed bug #14525: Workspacemenu JS is broken
        * Fixed bug #14522: Pagetree workspace div correction
 
 2010-05-30  Oliver Hader  <oliver@typo3.org>
index 2fa0d20..77e5f40 100644 (file)
@@ -184,9 +184,10 @@ class WorkspaceSelector implements backend_toolbarItem {
                $workspaceMenu       = array();
 
                $stateCheckedIcon = t3lib_iconWorks::getSpriteIcon('status-status-checked');
-       
-               $stateUncheckedIcon = '<img src="clear.gif" width="16" height="16" title="' . $GLOBALS['LANG']->getLL('shortcut_inactive') .
-                 '" alt="' . $GLOBALS['LANG']->getLL('shortcut_inactive') . '" class="state-inactive" />';
+
+               $stateUncheckedIcon = t3lib_iconWorks::getSpriteIcon('empty-empty', array(
+                       'title' => $GLOBALS['LANG']->getLL('shortcut_inactive')
+               ));
 
                $workspaceMenu[] = '<a href="#" class="toolbar-item"><img' .
                        t3lib_iconWorks::skinImg(
index 6377e1f..b1c2827 100644 (file)
@@ -113,16 +113,16 @@ var WorkspaceMenu = Class.create({
                var toggle = new Ajax.Request('ajax.php', {
                        parameters: 'ajaxID=WorkspaceMenu::toggleWorkspacePreview',
                        onSuccess: function(transport, response) {
-                               var stateActiveIcon = $$('#workspace-selector-menu img.state-active')[0].cloneNode(true);
-                               var stateInactiveIcon = $$('#workspace-selector-menu img.state-inactive')[0].cloneNode(true);
+                               var stateActiveClass = 't3-icon t3-icon-status t3-icon-status-status t3-icon-status-checked';
+                               var stateInactiveClass = 't3-icon t3-icon-empty t3-icon-empty-empty t3-icon-empty';
 
-                               if (response.newWorkspacePreviewState === 1) {
+                               if (response.newWorkspacePreviewState === '1') {
                                        TYPO3.configuration.workspaceFrontendPreviewEnabled = 1;
-                                       Event.element(event).previous().replace(stateActiveIcon);
+                                       Event.element(event).previous().removeClassName(stateInactiveClass).addClassName(stateActiveClass);
                                        top.WorkspaceFrontendPreviewEnabled = true;
                                } else {
                                        TYPO3.configuration.workspaceFrontendPreviewEnabled = 0;
-                                       Event.element(event).previous().replace(stateInactiveIcon);
+                                       Event.element(event).previous().removeClassName(stateActiveClass).addClassName(stateInactiveClass);
                                        top.WorkspaceFrontendPreviewEnabled = false;
                                }
                        }
@@ -152,15 +152,15 @@ var WorkspaceMenu = Class.create({
                                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);
+                               var stateActiveClass = 't3-icon t3-icon-status t3-icon-status-status t3-icon-status-checked';
+                               var stateInactiveClass = 't3-icon t3-icon-empty t3-icon-empty-empty t3-icon-empty';
 
                                        // remove "selected" class and checkmark
-                               $$('#workspace-selector-menu li.selected img.state-active')[0].replace(stateInactiveIcon);
+                               $$('#workspace-selector-menu li.selected span.t3-icon-status-checked')[0].removeClassName(stateActiveClass).addClassName(stateInactiveClass);
                                $$('#workspace-selector-menu li.selected')[0].removeClassName('selected');
 
                                        // add "selected" class and checkmark
-                               Event.element(event).previous().replace(stateActiveIcon);
+                               Event.element(event).previous().removeClassName(stateInactiveClass).addClassName(stateActiveClass);
                                Event.element(event).up().addClassName('selected');
 
                                        // when in web module reload, otherwise send the user to the web module