[TASK] Change clipboard drop down from splitted button to single button 72/40472/4
authorJan Helke <typo3@helke.de>
Fri, 19 Jun 2015 14:06:25 +0000 (16:06 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 22 Jun 2015 14:31:28 +0000 (16:31 +0200)
This patch changes the style for the drop down menu from one splitted
button to on single button. This is because the splitted button only
reacts on a click on the caret, which is a unwanted behaviour.

Releases: master
Resolves: #67631
Change-Id: I79edb58d6eebf5165ef5bafa6dc80ac1cfb3a208
Reviewed-on: http://review.typo3.org/40472
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/backend/Classes/Clipboard/Clipboard.php

index 7421d96..597a515 100644 (file)
@@ -246,12 +246,11 @@ class Clipboard {
 
                $copymodeSelector = '
                        <div class="btn-group">
-                               <button type="button" class="btn btn-default">' . ($this->currentMode() == 'copy' ? $copyLabel : $moveLabel) . '</button>
-                               <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+                               <button class="btn btn-default dropdown-toggle" type="button" id="copymodeSelector" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
+                                       ' . ($this->currentMode() === 'copy' ? $copyLabel : $moveLabel) . '
                                        <span class="caret"></span>
-                                       <span class="sr-only">Toggle Dropdown</span>
                                </button>
-                               <ul class="dropdown-menu">
+                               <ul class="dropdown-menu" aria-labelledby="copymodeSelector">
                                        <li><a href="#" onclick="document.getElementById(\'clipboard_form\').method=\'POST\'; document.getElementById(\'clipboard_form\').action=' . htmlspecialchars(GeneralUtility::quoteJSvalue($copymodeUrl . '&CB[setCopyMode]=')) . '; document.getElementById(\'clipboard_form\').submit(); return true;">' . $moveLabel . '</a></li>
                                        <li><a href="#" onclick="document.getElementById(\'clipboard_form\').method=\'POST\'; document.getElementById(\'clipboard_form\').action=' . htmlspecialchars(GeneralUtility::quoteJSvalue($copymodeUrl . '&CB[setCopyMode]=1')) . '; document.getElementById(\'clipboard_form\').submit(); return true;">' . $copyLabel . '</a></li>
                                </ul>
@@ -287,12 +286,11 @@ class Clipboard {
 
                $menuSelector = '
                        <div class="btn-group">
-                       <button type="button" class="btn btn-default">' . $this->clLabel('menu', 'rm') . '</button>
-                               <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+                               <button class="btn btn-default dropdown-toggle" type="button" id="menuSelector" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
+                                       ' . $this->clLabel('menu', 'rm') . '
                                        <span class="caret"></span>
-                                       <span class="sr-only">Toggle Dropdown</span>
                                </button>
-                               <ul class="dropdown-menu">
+                               <ul class="dropdown-menu" aria-labelledby="menuSelector">
                                        ' . implode('', $optionArray) . '
                                </ul>
                        </div>