[TASK] Add clear button for search in Backend User Listing 96/43596/2
authorWouter Wolters <typo3@wouterwolters.nl>
Sun, 27 Sep 2015 15:02:05 +0000 (17:02 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Mon, 28 Sep 2015 05:59:39 +0000 (07:59 +0200)
Resolves: #70135
Releases: master
Change-Id: I0619d5d92edde2c8e31609fce77c070d43a7e39d
Reviewed-on: http://review.typo3.org/43596
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/beuser/Resources/Private/Layouts/Default.html
typo3/sysext/beuser/Resources/Private/Partials/Filters/BackendUser/Index.html
typo3/sysext/beuser/Resources/Public/JavaScript/BackendUserListing.js [new file with mode: 0644]

index e432c7a..d789bae 100644 (file)
@@ -1,4 +1,4 @@
-<f:be.container includeRequireJsModules="{0: 'TYPO3/CMS/Backend/Modal'}">
+<f:be.container includeRequireJsModules="{0: 'TYPO3/CMS/Backend/Modal', 1: 'TYPO3/CMS/Beuser/BackendUserListing'}">
        <div class="typo3-fullDoc">
                <div id="typo3-docheader">
                        <div class="typo3-docheader-functions">
index 898494d..9f494b9 100644 (file)
@@ -2,11 +2,13 @@
 <f:form action="index" objectName="demand" object="{demand}" class="form-inline form-inline-spaced">
        <div class="form-group">
                <label for="tx_Beuser_username"><f:translate key="userName">Username</f:translate></label>
-               <f:form.textfield
-                       id="tx_Beuser_username"
-                       class="form-control input-sm"
-                       property="userName"
-               />
+               <div class="form-group">
+                       <f:form.textfield
+                               id="tx_Beuser_username"
+                               class="form-control input-sm"
+                               property="userName"
+                       />
+               </div>
        </div>
        <div class="form-group">
                <label for="tx_Beuser_usertype"><f:translate key="admin">Admin</f:translate></label>
diff --git a/typo3/sysext/beuser/Resources/Public/JavaScript/BackendUserListing.js b/typo3/sysext/beuser/Resources/Public/JavaScript/BackendUserListing.js
new file mode 100644 (file)
index 0000000..df03aea
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+/**
+ *  JavaScript for backend user listing
+ */
+define('TYPO3/CMS/Beuser/BackendUserListing', ['jquery', 'TYPO3/CMS/Backend/jquery.clearable'], function($) {
+
+       var $searchFields = $('#tx_Beuser_username');
+       var searchResultShown = ('' !== $searchFields.first().val());
+
+       // make search field clearable
+       $searchFields.clearable({
+               onClear: function() {
+                       if (searchResultShown) {
+                               $(this).closest('form').submit();
+                       }
+               }
+       });
+
+});
\ No newline at end of file