]> git.mxchange.org Git - friendica.git/commitdiff
Prevents Enter from submitting the jot form in the ACL search field
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 26 Aug 2019 01:03:29 +0000 (21:03 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 26 Aug 2019 01:03:29 +0000 (21:03 -0400)
- Disable browser autocomplete in jot ACL search field

view/js/acl.js
view/templates/acl_selector.tpl
view/theme/frio/templates/acl_selector.tpl

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){
index 6755f2a198fd13eab1af641a84eec303d647f420..da86a478bf12d0802c2b54b44357028ea10349a1 100644 (file)
@@ -1,6 +1,6 @@
 
 <div id="acl-wrapper">
-       <input id="acl-search">
+       <input id="acl-search" autocomplete="off">
        <a id="acl-showall">{{$showall}}</a>
        <div id="acl-list">
                <div id="acl-list-content">
index a96271671b20cea3fe91e15e1364ab6c14a1a258..47415634d12a2bb24725a68a99ce8f0fbc7fa4b8 100644 (file)
@@ -4,7 +4,7 @@
                <button id="acl-showall" class="btn btn-block btn-default"><i class="fa fa-globe"></i> {{$showall}}</button>
        </div>
        <div class="form-group form-group-search">
-               <input type="text" id="acl-search" class="form-control form-search">
+               <input type="text" id="acl-search" class="form-control form-search" autocomplete="off">
        </div>
        <div id="acl-list">
                <div id="acl-list-content"></div>