Ticket #41489: 41489.3.patch
File 41489.3.patch, 1.7 KB (added by , 7 years ago) |
---|
-
wp-includes/js/customize-preview.js
327 327 * @returns {void} 328 328 */ 329 329 api.prepareLinkPreview = function prepareLinkPreview( element ) { 330 var queryParams ;330 var queryParams, $element = $( element ); 331 331 332 332 // Skip links in admin bar. 333 if ( $ ( element ).closest( '#wpadminbar' ).length ) {333 if ( $element.closest( '#wpadminbar' ).length ) { 334 334 return; 335 335 } 336 336 337 337 // Ignore links with href="#", href="#id", or non-HTTP protocols (e.g. javascript: and mailto:). 338 if ( '#' === $ ( element ).attr( 'href' ).substr( 0, 1 ) || ! /^https?:$/.test( element.protocol ) ) {338 if ( '#' === $element.attr( 'href' ).substr( 0, 1 ) || ! /^https?:$/.test( element.protocol ) ) { 339 339 return; 340 340 } 341 341 … … 344 344 element.protocol = 'https:'; 345 345 } 346 346 347 // Ignore links with class wp-playlist-caption 348 if ( $element.hasClass( 'wp-playlist-caption' ) ) { 349 return; 350 } 351 347 352 if ( ! api.isLinkPreviewable( element ) ) { 348 353 349 354 // Style link as unpreviewable only if previewing in iframe; if previewing on frontend, links will be allowed to work normally. 350 355 if ( api.settings.channel ) { 351 $ ( element ).addClass( 'customize-unpreviewable' );356 $element.addClass( 'customize-unpreviewable' ); 352 357 } 353 358 return; 354 359 } 355 $ ( element ).removeClass( 'customize-unpreviewable' );360 $element.removeClass( 'customize-unpreviewable' ); 356 361 357 362 queryParams = api.utils.parseQueryString( element.search.substring( 1 ) ); 358 363 queryParams.customize_changeset_uuid = api.settings.changeset.uuid;