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
This commit is contained in:
Weston Ruter 2017-09-06 17:59:53 +00:00
parent 849cf3efb7
commit 706daad00d
1 changed files with 10 additions and 5 deletions

View File

@ -327,15 +327,15 @@
* @returns {void} * @returns {void}
*/ */
api.prepareLinkPreview = function prepareLinkPreview( element ) { api.prepareLinkPreview = function prepareLinkPreview( element ) {
var queryParams; var queryParams, $element = $( element );
// Skip links in admin bar. // Skip links in admin bar.
if ( $( element ).closest( '#wpadminbar' ).length ) { if ( $element.closest( '#wpadminbar' ).length ) {
return; return;
} }
// Ignore links with href="#", href="#id", or non-HTTP protocols (e.g. javascript: and mailto:). // 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; return;
} }
@ -344,15 +344,20 @@
element.protocol = 'https:'; element.protocol = 'https:';
} }
// Ignore links with class wp-playlist-caption
if ( $element.hasClass( 'wp-playlist-caption' ) ) {
return;
}
if ( ! api.isLinkPreviewable( element ) ) { if ( ! api.isLinkPreviewable( element ) ) {
// Style link as unpreviewable only if previewing in iframe; if previewing on frontend, links will be allowed to work normally. // Style link as unpreviewable only if previewing in iframe; if previewing on frontend, links will be allowed to work normally.
if ( api.settings.channel ) { if ( api.settings.channel ) {
$( element ).addClass( 'customize-unpreviewable' ); $element.addClass( 'customize-unpreviewable' );
} }
return; return;
} }
$( element ).removeClass( 'customize-unpreviewable' ); $element.removeClass( 'customize-unpreviewable' );
queryParams = api.utils.parseQueryString( element.search.substring( 1 ) ); queryParams = api.utils.parseQueryString( element.search.substring( 1 ) );
queryParams.customize_changeset_uuid = api.settings.changeset.uuid; queryParams.customize_changeset_uuid = api.settings.changeset.uuid;