[wp-trac] [WordPress Trac] #41489: Customize Preview: do not show `cursor: not-allowed` on audio/video track titles within playlists

WordPress Trac noreply at wordpress.org
Tue Sep 5 19:47:19 UTC 2017


#41489: Customize Preview: do not show `cursor: not-allowed` on audio/video track
titles within playlists
------------------------------------------+------------------
 Reporter:  celloexpressions              |       Owner:
     Type:  defect (bug)                  |      Status:  new
 Priority:  normal                        |   Milestone:  4.9
Component:  Customize                     |     Version:  4.7
 Severity:  normal                        |  Resolution:
 Keywords:  good-first-bug needs-testing  |     Focuses:  ui
------------------------------------------+------------------

Comment (by scott.deluzio):

 The 'if' line in the patch added by @mitraval192 should be this:
 {{{
 if ( element.hasClass( 'wp-playlist-caption' ) ) {
 }}}
 not this (note missing ending parenthesis):
 {{{
 if ( element.hasClass( 'wp-playlist-caption' ) {
 }}}

 That patch also seems to add errors to the customize preview:
 {{{
 Uncaught TypeError: element.hasClass is not a function
     at Function.prepareLinkPreview (customize-
 preview.js?ver=4.9-alpha-40870-src:349)
     at HTMLAnchorElement.<anonymous> (customize-
 preview.js?ver=4.9-alpha-40870-src:236)
     at Function.each (jquery.js?ver=1.12.4:2)
     at jQuery.fn.init.each (jquery.js?ver=1.12.4:2)
     at Function.addLinkPreviewing (customize-
 preview.js?ver=4.9-alpha-40870-src:235)
     at HTMLDocument.<anonymous> (customize-
 preview.js?ver=4.9-alpha-40870-src:670)
     at i (jquery.js?ver=1.12.4:2)
     at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4:2)
     at Function.ready (jquery.js?ver=1.12.4:2)
     at HTMLDocument.K (jquery.js?ver=1.12.4:2)
 prepareLinkPreview @ customize-preview.js?ver=4.9-alpha-40870-src:349
 (anonymous) @ customize-preview.js?ver=4.9-alpha-40870-src:236
 each @ jquery.js?ver=1.12.4:2
 each @ jquery.js?ver=1.12.4:2
 addLinkPreviewing @ customize-preview.js?ver=4.9-alpha-40870-src:235
 (anonymous) @ customize-preview.js?ver=4.9-alpha-40870-src:670
 i @ jquery.js?ver=1.12.4:2
 fireWith @ jquery.js?ver=1.12.4:2
 ready @ jquery.js?ver=1.12.4:2
 K @ jquery.js?ver=1.12.4:2
 }}}

 My proposed patch uses element.classList.contains instead of
 element.hasClass, which does not output the errors found in the previous
 patch.

 It is inserted after the "Make sure links in preview use HTTPS if parent
 frame uses HTTPS." check. This ensures that HTTPS can be applied to the
 links if the parent frame uses HTTPS rather than returning before that
 check as was proposed by @westonruter.

 It still returns before adding the customize-unpreviewable class.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41489#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list