[TASK] Toolbar: Move icon into link
authorFelix Kopp <felix-source@phorax.com>
Sat, 14 Apr 2012 17:50:31 +0000 (19:50 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Sat, 18 Aug 2012 13:00:49 +0000 (15:00 +0200)
In toolbaritem flyout a checked/unchecked icon is displayed.
Moves that icon into the link tag - this way also the icon can be clicked.

Change-Id: I305614d361fe4f207041099aa3a78e2f01ad3f7c
Fixes: #33858
Releases: 4.5, 4.6, 4.7, 6.0
Reviewed-on: http://review.typo3.org/10488
Reviewed-by: Wouter Wolters
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/workspaces/Classes/ExtDirect/WorkspaceSelectorToolbarItem.php
typo3/sysext/workspaces/Resources/Public/JavaScript/workspacemenu.js

index 7acc7cb..01d37e5 100644 (file)
@@ -117,10 +117,10 @@ class Tx_Workspaces_ExtDirect_WorkspaceSelectorToolbarItem implements backend_to
                                        $icon = $stateCheckedIcon;
                                }
 
-                               $workspaceMenu[] = '<li' . $selected . '>' . $icon .
-                                       ' <a href="backend.php?changeWorkspace=' .
+                               $workspaceMenu[] = '<li' . $selected . '>' .
+                                       '<a href="backend.php?changeWorkspace=' .
                                        intval($workspaceId) . '" id="ws-' . intval($workspaceId) .
-                                       '" class="ws">' . htmlspecialchars($label) . '</a></li>';
+                                       '" class="ws">' . $icon . ' ' . htmlspecialchars($label) . '</a></li>';
                        }
                } else {
                        $workspaceMenu[] = '<li>' . $stateUncheckedIcon . ' ' .
index b57136d..bf239a4 100644 (file)
@@ -142,11 +142,11 @@ var WorkspaceMenu = Class.create({
                var stateInactiveClass = 't3-icon t3-icon-empty t3-icon-empty-empty t3-icon-empty';
 
                // remove "selected" class and checkmark
-               $$('#workspace-selector-menu li.selected span.t3-icon-status-checked')[0].removeClassName(stateActiveClass).addClassName(stateInactiveClass);
+               $$('#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
-               $$('#ws-' + id)[0].previous().removeClassName(stateInactiveClass).addClassName(stateActiveClass);
+               $$('#ws-' + id)[0].down().removeClassName(stateInactiveClass).addClassName(stateActiveClass);
                $$('#ws-' + id)[0].up().addClassName('selected');
        },