[Rt-commit] rt branch, 4.4-trunk, updated. rt-4.4.4-85-g9d3392297

? sunnavy sunnavy at bestpractical.com
Thu Feb 13 17:58:08 EST 2020


The branch, 4.4-trunk has been updated
       via  9d3392297ab8e907952f2d65a2443e6aa63c3f8e (commit)
       via  c412bce5f345a61cb12056be0ce2795ddcd4f431 (commit)
       via  95867dc1b5312311593c2f75859ad93c9222b6af (commit)
       via  c2035aa8572ee2a5cf80ebea7aa3509ef6e06d2d (commit)
      from  dd396c5661d12511f5516cc4b426ef118ad67aab (commit)

Summary of changes:
 share/static/js/autocomplete.js | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit 9d3392297ab8e907952f2d65a2443e6aa63c3f8e
Merge: dd396c566 c412bce5f
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Feb 14 06:54:28 2020 +0800

    Merge branch '4.2-trunk' into 4.4-trunk

diff --cc share/static/js/autocomplete.js
index cd8ab2b0d,0bed0037d..8040bef14
--- a/share/static/js/autocomplete.js
+++ b/share/static/js/autocomplete.js
@@@ -61,18 -46,20 +61,22 @@@ window.RT.Autocomplete.bind = function(
              options.select = function(event, ui) {
                  var terms = this.value.split(what == 'Tickets' ? /\s+/ : /,\s*/);
                  terms.pop();                    // remove current input
-                 terms.push( ui.item.value );    // add selected item
                  if ( what == 'Tickets' ) {
                      // remove non-integers in case subject search with spaces in (like "foo bar")
-                     terms = jQuery.grep(terms, function(term) {
-                         var str = term + ''; // stringify integers to call .match
-                         return str.match(/^\d+$/);
-                     } );
+                     var new_terms = [];
+                     for ( var i = 0; i < terms.length; i++ ) {
+                         if ( terms[i].match(/\D/) ) {
+                             break; // Items after the first non-integers are all parts of search string
+                         }
+                         new_terms.push(terms[i]);
+                     }
+                     terms = new_terms;
                  }
+                 terms.push( ui.item.value );    // add selected item
                  terms.push(''); // add trailing delimeter so user can input another value directly
                  this.value = terms.join(what == 'Tickets' ? ' ' : ", ");
 +                jQuery(this).change();
 +
                  return false;
              }
          }

-----------------------------------------------------------------------


More information about the rt-commit mailing list