]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/jquery/suggest.js
WordPress 4.6.3-scripts
[autoinstalls/wordpress.git] / wp-includes / js / jquery / suggest.js
index 60e15c1f8cd2da988a9b1a393decd673dd5f26d3..97aab0523793d89168b8fd0b46003bff8df9ef3c 100644 (file)
@@ -30,8 +30,8 @@
 
                resetPosition();
                $(window)
-                       .load(resetPosition)            // just in case user is changing size of page while loading
-                       .resize(resetPosition);
+                       .on( 'load', resetPosition ) // just in case user is changing size of page while loading
+                       .on( 'resize', resetPosition );
 
                $input.blur(function() {
                        setTimeout(function() { $results.hide() }, 200);
                        if ($currentResult) {
                                if ( options.multiple ) {
                                        if ( $input.val().indexOf(options.multipleSep) != -1 ) {
-                                               $currentVal = $input.val().substr( 0, ( $input.val().lastIndexOf(options.multipleSep) + options.multipleSep.length ) );
+                                               $currentVal = $input.val().substr( 0, ( $input.val().lastIndexOf(options.multipleSep) + options.multipleSep.length ) ) + ' ';
                                        } else {
                                                $currentVal = "";
                                        }
-                                       $input.val( $currentVal + $currentResult.text() + options.multipleSep);
+                                       $input.val( $currentVal + $currentResult.text() + options.multipleSep + ' ' );
                                        $input.focus();
                                } else {
                                        $input.val($currentResult.text());
 
                options = options || {};
                options.multiple = options.multiple || false;
-               options.multipleSep = options.multipleSep || ", ";
+               options.multipleSep = options.multipleSep || ",";
                options.source = source;
                options.delay = options.delay || 100;
                options.resultsClass = options.resultsClass || 'ac_results';