[TASK] Add clear button for LiveSearch 77/43577/6
authorWouter Wolters <typo3@wouterwolters.nl>
Fri, 25 Sep 2015 18:58:24 +0000 (20:58 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Thu, 8 Oct 2015 21:44:02 +0000 (23:44 +0200)
Resolves: #70508
Releases: master
Change-Id: Ifad9feb4ab07d201a769580631d0c1f3fb76b38c
Reviewed-on: http://review.typo3.org/43577
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
Build/Resources/Public/Less/TYPO3/_topbar.less
typo3/sysext/backend/Resources/Public/JavaScript/LiveSearch.js
typo3/sysext/t3skin/Resources/Public/Css/backend.css

index 3a36ca4..d8697c5 100644 (file)
                        margin-top: -8px;
                        z-index: 1;
                }
+
+               button.close {
+                       opacity: 1;
+                       color: @topbar-navigation-color;
+                       text-shadow: none;
+               }
        }
        .form-control {
                background-color: @tobar-navigation-search-bg;
index 35be20a..dec2649 100644 (file)
@@ -14,7 +14,7 @@
 /**
  * Global search to deal with everything in the backend that is search-related
  */
-define('TYPO3/CMS/Backend/LiveSearch', ['jquery', 'jquery/autocomplete'], function ($) {
+define('TYPO3/CMS/Backend/LiveSearch', ['jquery', 'jquery/autocomplete', 'TYPO3/CMS/Backend/jquery.clearable'], function ($) {
 
        var containerSelector = '#typo3-cms-backend-backend-toolbaritems-livesearchtoolbaritem';
        var searchFieldSelector = '.t3js-topbar-navigation-search-field';
@@ -92,6 +92,14 @@ define('TYPO3/CMS/Backend/LiveSearch', ['jquery', 'jquery/autocomplete'], functi
                        evt.preventDefault();
                        jump($(this).data('target'), 'web_list', 'web', $(this).data('pageid'));
                });
+
+               $(searchFieldSelector).clearable(
+                       {
+                               onClear: function() {
+                                       $(containerSelector).removeClass('open');
+                               }
+                       }
+               );
        };
 
        $(document).ready(function() {
index cd3e29f..9fc7cb1 100644 (file)
@@ -13277,6 +13277,11 @@ iframe {
   margin-top: -8px;
   z-index: 1;
 }
+.typo3-topbar-navigation-search .form-group button.close {
+  opacity: 1;
+  color: #dddddd;
+  text-shadow: none;
+}
 .typo3-topbar-navigation-search .form-control {
   background-color: #222222;
   color: #dddddd;