[wp-trac] [WordPress Trac] #27341: .uploader-window doesn't disappear

WordPress Trac noreply at wordpress.org
Thu Mar 13 16:46:08 UTC 2014


#27341: .uploader-window doesn't disappear
-------------------------------------------------+-------------------------
 Reporter:  ericlewis                            |       Owner:
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  3.9
Component:  Media                                |     Version:  3.7
 Severity:  normal                               |  Resolution:
 Keywords:  dev-feedback has-patch needs-        |     Focuses:  javascript
  testing                                        |
-------------------------------------------------+-------------------------
Changes (by kovshenin):

 * keywords:  reporter-feedback => dev-feedback has-patch needs-testing
 * focuses:  ui => javascript
 * version:  trunk => 3.7


Comment:

 This was pretty fun to reproduce. Not really :)

 tldr: You have to be super lucky, and there's a patch.

 All you have to do is drag a file, and drop it *right* when the overlay
 opacity is 1, but the transition.end event hasn't fired yet. As soon as
 you drop the file you'll call UploaderWindow's hide() method, where
 media.transition() attaches the deferred resolution to the transition.end
 event, which happens right about... now!

 Our deferred is resolved when the opacity:1 transition ends and the
 opacity:0 transition has just begun, at which point the opacity is right
 around 0.9-ish and our function in .done() just bails.

 You can watch all of this in action by logging transition end events:

 {{{
 this.$el.on( $.support.transition.end, function() {
     console.log( 'ended transition' );
 });
 }}}

 And some others, like when hide() is called and when the element is
 actually hidden. You'll see two "ended transition" entries in a row when
 you're lucky enough. It'll take a while... Setting the transition time to
 1500ms in media-views.css for .uploader-window and the background opacity
 to 1.0 can also help :)

 I'm not sure what the best fix would be, but I have an idea.

 In media.transition() we have a deferred resolution on _.delay() which is
 fired if transition.end never happens. This can saves us from when someone
 drops a file very very quickly before the dropzone is even shown. But it
 doesn't account for when transition.end in misfired earlier.

 So the idea is something very similar, only in UploaderWindow, see
 [attachment:27341.diff].

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


More information about the wp-trac mailing list