After [33821], when dynamically updating the document title text of the Comments List Table page, operate only on the fragment that contains the comment count. This prevents us from including other numbers that may be present in the other title parts (site title, etc).
See #33414. Built from https://develop.svn.wordpress.org/trunk@33982 git-svn-id: http://core.svn.wordpress.org/trunk@33951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0f3f7160e4
commit
bbbbf11961
|
@ -138,15 +138,23 @@ setCommentsList = function() {
|
|||
};
|
||||
|
||||
updateHtmlTitle = function ( diff ) {
|
||||
var newTitle, regExMatch, titleCount;
|
||||
var newTitle, regExMatch, titleCount, commentFrag;
|
||||
|
||||
titleRegEx = titleRegEx || new RegExp( 'Comments (\\([0-9' + thousandsSeparator + ']+\\))?' );
|
||||
// count funcs operate on a $'d element
|
||||
titleDiv = titleDiv || $( '<div />' );
|
||||
newTitle = adminTitle;
|
||||
|
||||
titleDiv.html( document.title );
|
||||
titleCount = getCount( titleDiv ) + diff;
|
||||
commentFrag = titleRegEx.exec( document.title );
|
||||
if ( commentFrag ) {
|
||||
commentFrag = commentFrag[0];
|
||||
titleDiv.html( commentFrag );
|
||||
titleCount = getCount( titleDiv ) + diff;
|
||||
} else {
|
||||
titleDiv.html( 0 );
|
||||
titleCount = diff;
|
||||
}
|
||||
|
||||
if ( titleCount >= 1 ) {
|
||||
updateCount( titleDiv, titleCount );
|
||||
regExMatch = titleRegEx.exec( document.title );
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.4-alpha-33981';
|
||||
$wp_version = '4.4-alpha-33982';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue