[wp-trac] [WordPress Trac] #36533: Doesn't work browse media libary on Frontend

WordPress Trac noreply at wordpress.org
Wed Apr 20 13:41:23 UTC 2016


#36533: Doesn't work browse media libary on Frontend
-----------------------------------------+------------------------------
 Reporter:  purevtsooj                   |       Owner:
     Type:  defect (bug)                 |      Status:  new
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  Media                        |     Version:  4.5
 Severity:  normal                       |  Resolution:
 Keywords:  reporter-feedback has-patch  |     Focuses:  javascript
-----------------------------------------+------------------------------

Comment (by pcnetworkx):

 Hi, was wondering if someone could help me out with where to modify this
 code exactly as I'm not a programmer by default, looking at @justinbusa
 commentI did some more testing and think I have figured out the issue as
 well as a fix.
 I'm not sure why, but in the latest version of jQuery, when this CSS is
 present...
 table {
   border-style: solid;
   border-collapse: collapse;
 }
 $el.is(':visible') will return true, even if the element isn't in the DOM.
 This is preventing the media library from being shown because
 wp.media.open will return on line 6765 of wp-includes/js/media-views.js
 even though $el isn't visible because it hasn't been inserted into the DOM
 when open is first called...
 if ( $el.is(':visible') ) {
         return this;
 }
 The solution is to check and see if $el is in the document in addition to
 the $el.is(':visible') check...
 if ( $el.is(':visible') && $.contains( document, $el[ 0 ] ) ) {
         return this;
 }
 I have tested and can confirm that this works to solve the issue. Patch to
 follow...

 ths seem to fix the issue I'm just not sure where and what to edit

 Thanks,

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


More information about the wp-trac mailing list