Make WordPress Core

Changeset 28851


Ignore:
Timestamp:
06/26/2014 04:07:36 PM (10 years ago)
Author:
SergeyBiryukov
Message:

Fix unexpected replacement of a previous tag when selecting a tag from autosuggest results.

props camdensegal.
fixes #28471.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/inline-edit-post.js

    r28600 r28851  
    111111            // support multi taxonomies?
    112112            tax = 'post_tag';
    113             $('tr.inline-editor textarea[name="tax_input['+tax+']"]').suggest( ajaxurl + '?action=ajax-tag-search&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: inlineEditL10n.comma + ' ' } );
     113            $('tr.inline-editor textarea[name="tax_input['+tax+']"]').suggest( ajaxurl + '?action=ajax-tag-search&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: inlineEditL10n.comma } );
    114114        }
    115115        $('html, body').animate( { scrollTop: 0 }, 'fast' );
     
    196196            }
    197197
    198             textarea.suggest( ajaxurl + '?action=ajax-tag-search&tax=' + taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: inlineEditL10n.comma + ' ' } );
     198            textarea.suggest( ajaxurl + '?action=ajax-tag-search&tax=' + taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: inlineEditL10n.comma } );
    199199        });
    200200
  • trunk/src/wp-includes/js/jquery/suggest.js

    r26333 r28851  
    241241                if ( options.multiple ) {
    242242                    if ( $input.val().indexOf(options.multipleSep) != -1 ) {
    243                         $currentVal = $input.val().substr( 0, ( $input.val().lastIndexOf(options.multipleSep) + options.multipleSep.length ) );
     243                        $currentVal = $input.val().substr( 0, ( $input.val().lastIndexOf(options.multipleSep) + options.multipleSep.length ) ) + ' ';
    244244                    } else {
    245245                        $currentVal = "";
    246246                    }
    247                     $input.val( $currentVal + $currentResult.text() + options.multipleSep);
     247                    $input.val( $currentVal + $currentResult.text() + options.multipleSep + ' ' );
    248248                    $input.focus();
    249249                } else {
     
    295295        options = options || {};
    296296        options.multiple = options.multiple || false;
    297         options.multipleSep = options.multipleSep || ", ";
     297        options.multipleSep = options.multipleSep || ",";
    298298        options.source = source;
    299299        options.delay = options.delay || 100;
  • trunk/src/wp-includes/script-loader.php

    r28801 r28851  
    477477            'ntdeltitle' => __('Remove From Bulk Edit'),
    478478            'notitle' => __('(no title)'),
    479             'comma' => _x( ',', 'tag delimiter' ),
     479            'comma' => trim( _x( ',', 'tag delimiter' ) ),
    480480        ) );
    481481
Note: See TracChangeset for help on using the changeset viewer.