]> source.dussan.org Git - nextcloud-server.git/commitdiff
add reset button for the filter field
authorArthur Schiwon <blizzz@owncloud.com>
Thu, 17 Apr 2014 20:14:04 +0000 (22:14 +0200)
committerArthur Schiwon <blizzz@owncloud.com>
Mon, 2 Jun 2014 10:53:57 +0000 (12:53 +0200)
settings/css/settings.css
settings/js/users/filter.js
settings/js/users/users.js
settings/templates/users/part.createuser.php

index e6ad4fd304f91b663116e10a0177dd0cc6796090..604b5024371a8232f6d70ae5042062d7b4180abc 100644 (file)
@@ -63,8 +63,8 @@ li.active span.utils .delete {
 }
 li.active .rename {
        padding: 8px 14px 20px 14px;
-       top: 0px; position: absolute; width: 16px; height: 16px; 
-       opacity: 0.5; 
+       top: 0px; position: absolute; width: 16px; height: 16px;
+       opacity: 0.5;
        display: inline-block !important;
 }
 li.active span.utils .delete img { margin: 14px; }
@@ -108,6 +108,12 @@ div.quota>span {
 }
 select.quota.active { background: #fff; }
 
+input.userFilter {width: 200px;}
+span.userFilterReset {
+       width: 16px; height: 16px; position: absolute;
+       padding-top: 20px; margin-left: -20px;
+}
+
 /* positioning fixes */
 #newuser .multiselect {
        min-width: 150px !important;
index 456c51376b907b90ca1c784e221ad7a4bd3fce44..403e9c00c11a283d9b6916f0a632310752c06e3f 100644 (file)
@@ -71,3 +71,15 @@ UserManagementFilter.prototype.run = function() {
 UserManagementFilter.prototype.getPattern = function() {
        return this.filterInput.val();
 };
+
+/**
+ * @brief adds reset functionality to an HTML element
+ * @param jQuery the jQuery representation of that element
+ */
+UserManagementFilter.prototype.addResetButton = function(button) {
+       var umf = this;
+       button.click(function(){
+               umf.filterInput.val('');
+               umf.run();
+       });
+};
\ No newline at end of file
index 092998c029f28c504135c4876629f06cd40c6a63..3832464c3468f93b2b40e25e6dc73e33debbd6c5 100644 (file)
@@ -425,6 +425,7 @@ $(document).ready(function () {
        // Implements User Search
        filter = new UserManagementFilter(
                $('#usersearchform input'), UserList, GroupList);
+       filter.addResetButton($('.userFilterReset').first());
 
        UserList.doSort();
        UserList.availableGroups = $('#content table').data('groups');
index 6af1e934e1dcae7a6ebb8068b8f240b5ddd4940e..2e37f3885a0c874e0bb5cccb04c5bb6f23943a10 100644 (file)
@@ -27,6 +27,7 @@
        </div>
        <?php endif; ?>
        <form autocomplete="off" id="usersearchform">
-               <input type="text" class="input" placeholder="<?php p($l->t('Search Users and Groups')); ?>" />
+               <input type="text" class="input userFilter" placeholder="<?php p($l->t('Search Users and Groups')); ?>" />
+               <span  class="svg icon-delete userFilterReset"></a>
        </form>
 </div>
\ No newline at end of file