[BUGFIX] Livesearch toolbar should close others
authorTolleiv Nietsch <info@tolleiv.de>
Sat, 4 Feb 2012 09:28:14 +0000 (10:28 +0100)
committerSteffen Ritter <info@rs-websystems.de>
Thu, 15 Mar 2012 07:08:01 +0000 (08:08 +0100)
When focussing the livesearch in the backend, other menus
should be closed.

Change-Id: Ibc6e9727ab9142f549bef3d5615bcb1426b42ebe
Fixes: #32890
Release: 4.7, 4.6
Reviewed-on: http://review.typo3.org/8837
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Stefan Neufeind
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
Reviewed-by: Sebastian Fischer
typo3/js/livesearch.js
typo3/js/toolbarmanager.js

index bd27540..531a379 100644 (file)
@@ -257,6 +257,7 @@ TYPO3.BackendLiveSearch = Ext.extend(Ext.form.ComboBox, {
 
        onFocus : function() {
                TYPO3.BackendLiveSearch.superclass.onFocus.apply(this, arguments);
+               TYPO3BackendToolbarManager.hideAll();
 
                // If search is blank, show the help on focus. Otherwise, show last results
                if (this.getValue() == '') {
index 5047480..30fa507 100644 (file)
@@ -35,18 +35,23 @@ var ToolbarManager = Class.create({
 
                        // check whether it is a toolbar item with menu
                if (sibling.hasClassName('toolbar-item-menu')) {
-                               // hide all
-                       $$('#typo3-toolbar a.toolbar-item + .toolbar-item-menu').invoke('hide');
-                       $$('#typo3-toolbar a.toolbar-item').each(function(element) {
-                               element.removeClassName('toolbar-item-active');
-                       });
-
+                       this.hideAll();
                                // show toolbarItem
                        toolbarItem.addClassName('toolbar-item-active');
                }
        },
 
        /**
+        * Hide all expanded toolbar menus
+        */
+       hideAll: function() {
+               $$('#typo3-toolbar a.toolbar-item + .toolbar-item-menu').invoke('hide');
+               $$('#typo3-toolbar a.toolbar-item').each(function(element) {
+                       element.removeClassName('toolbar-item-active');
+               });
+       },
+
+       /**
         * refreshs positioning of all submenus
         */
        refreshAll: function() {