From 706daad00dd92feb2663f66d42c9fd465acda9b1 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 6 Sep 2017 17:59:53 +0000 Subject: [PATCH] Customize: Do not show `cursor: not-allowed` on audio/video track titles within playlists in preview. Props scott.deluzio, mitraval192, westonruter. See #31517. Fixes #41489. git-svn-id: https://develop.svn.wordpress.org/trunk@41338 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/customize-preview.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/js/customize-preview.js b/src/wp-includes/js/customize-preview.js index adb9f03847..5495590faf 100644 --- a/src/wp-includes/js/customize-preview.js +++ b/src/wp-includes/js/customize-preview.js @@ -327,15 +327,15 @@ * @returns {void} */ api.prepareLinkPreview = function prepareLinkPreview( element ) { - var queryParams; + var queryParams, $element = $( element ); // Skip links in admin bar. - if ( $( element ).closest( '#wpadminbar' ).length ) { + if ( $element.closest( '#wpadminbar' ).length ) { return; } // Ignore links with href="#", href="#id", or non-HTTP protocols (e.g. javascript: and mailto:). - if ( '#' === $( element ).attr( 'href' ).substr( 0, 1 ) || ! /^https?:$/.test( element.protocol ) ) { + if ( '#' === $element.attr( 'href' ).substr( 0, 1 ) || ! /^https?:$/.test( element.protocol ) ) { return; } @@ -344,15 +344,20 @@ element.protocol = 'https:'; } + // Ignore links with class wp-playlist-caption + if ( $element.hasClass( 'wp-playlist-caption' ) ) { + return; + } + if ( ! api.isLinkPreviewable( element ) ) { // Style link as unpreviewable only if previewing in iframe; if previewing on frontend, links will be allowed to work normally. if ( api.settings.channel ) { - $( element ).addClass( 'customize-unpreviewable' ); + $element.addClass( 'customize-unpreviewable' ); } return; } - $( element ).removeClass( 'customize-unpreviewable' ); + $element.removeClass( 'customize-unpreviewable' ); queryParams = api.utils.parseQueryString( element.search.substring( 1 ) ); queryParams.customize_changeset_uuid = api.settings.changeset.uuid;