[TASK] Install: Added clearer to All Configuration search field 30/45230/3
authorMichael Oehlhof <typo3@oehlhof.de>
Sun, 13 Dec 2015 23:18:28 +0000 (00:18 +0100)
committerFrank Nägler <frank.naegler@typo3.org>
Mon, 14 Dec 2015 10:23:47 +0000 (11:23 +0100)
Resolves: #71381
Releases: master
Change-Id: I7aca3ffbcd85a3a2a564ade34d8da77d5b1d2bc4
Reviewed-on: https://review.typo3.org/45230
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Frank Nägler <frank.naegler@typo3.org>
Tested-by: Frank Nägler <frank.naegler@typo3.org>
Build/Resources/Public/Less/InstallTool.less
typo3/sysext/install/Resources/Private/Partials/Action/Common/Headers.html
typo3/sysext/install/Resources/Public/Css/InstallTool.css
typo3/sysext/install/Resources/Public/JavaScript/Install.js

index 80b7814..6bfdd39 100644 (file)
@@ -181,3 +181,32 @@ hr {
                }
        }
 }
+
+//
+// Styles for the "clearable" jquery plugin.
+//
+.form-control-clearable {
+       position: relative;
+       .form-control {
+               padding-right: 2.3em;
+       }
+       .close {
+               position: absolute;
+               z-index: 3;
+               font-size: 1.2em;
+               top: 50%;
+               right: 0.5em;
+               margin-top: -0.55em;
+               &:before {
+                       line-height: 1.5em;
+               }
+       }
+}
+.input-group {
+       .form-control-clearable {
+               display: table-cell;
+               .form-control {
+                       display: block;
+               }
+       }
+}
index be689f8..2b75945 100644 (file)
@@ -3,5 +3,6 @@
 <link rel="stylesheet" type="text/css" href="../Resources/Public/Css/InstallTool.css?{time}" />
 <link rel="icon" type="image/vnd.microsoft.icon" href="../Resources/Public/Icons/favicon.ico" />
 <script type="text/javascript" src="../../core/Resources/Public/JavaScript/Contrib/jquery/jquery-2.1.4.min.js?{time}"></script>
+<script type="text/javascript" src="../../backend/Resources/Public/JavaScript/jquery.clearable.js?{time}"></script>
 <script type="text/javascript" src="../Resources/Public/JavaScript/bootstrap.min.js?{time}"></script>
 <script type="text/javascript" src="../Resources/Public/JavaScript/Install.js?{time}"></script>
index 884efec..7615c7c 100644 (file)
@@ -8354,3 +8354,26 @@ hr {
 #install-menu-button .navbar-toggle .icon-bar {
   background-color: black;
 }
+.form-control-clearable {
+  position: relative;
+}
+.form-control-clearable .form-control {
+  padding-right: 2.3em;
+}
+.form-control-clearable .close {
+  position: absolute;
+  z-index: 3;
+  font-size: 1.2em;
+  top: 50%;
+  right: 0.5em;
+  margin-top: -0.55em;
+}
+.form-control-clearable .close:before {
+  line-height: 1.5em;
+}
+.input-group .form-control-clearable {
+  display: table-cell;
+}
+.input-group .form-control-clearable .form-control {
+  display: block;
+}
index c7d7cfa..a34d5a5 100644 (file)
@@ -622,6 +622,17 @@ $(function() {
                $('div.item').not(':contains(' + typedQuery + ')').removeClass('searchhit').addClass('hidden');
                $('.searchhit').parent().collapse('show');
        });
+       var $searchFields = $('#configSearch');
+       var searchResultShown = ('' !== $searchFields.first().val());
+
+       // make search field clearable
+       $searchFields.clearable({
+               onClear: function() {
+                       if (searchResultShown) {
+                               $(this).closest('form').submit();
+                       }
+               }
+       });
 
        // Define width of fixed menu
        var $menuWrapper = $('#menuWrapper');