Changeset 41338
- Timestamp:
- 09/06/2017 05:59:53 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/customize-preview.js
r40381 r41338 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 } … … 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 ) );
Note: See TracChangeset
for help on using the changeset viewer.