]> git.mxchange.org Git - friendica.git/blobdiff - view/js/acl.js
Improve search box
[friendica.git] / view / js / acl.js
index d01ffe7cbd684790a7ef229d741591a4b0f2a515..b50dbaec8d947abb7eb1d42c34b86719136af450 100644 (file)
@@ -109,7 +109,14 @@ ACL.prototype.search = function(){
 
 ACL.prototype.on_search = function(event){
        if (this.kp_timer) clearTimeout(this.kp_timer);
-       this.kp_timer = setTimeout( this.search.bind(this), 1000);
+
+       // Triggers an immediate search while preventing form submission
+       if (event.key === 'Enter') {
+               this.search();
+               event.preventDefault();
+       } else {
+               this.kp_timer = setTimeout( this.search.bind(this), 500);
+       }
 };
 
 ACL.prototype.on_showall = function(event){