From 3ace2eba1d01916e74885c4c6f62be1da461c4b4 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 26 Jun 2014 01:19:18 +0000 Subject: [PATCH] Race conditions can cause `.uploader-window` to be visible with opacity of `0`. It will cause the user to have to refresh the page or inspect the element to hide it. Add a delay in `wp.media.view.UploaderWindow.hide()` to ensure that the uploader window is indeed hidden. Props kovshenin. Fixes #27341. git-svn-id: https://develop.svn.wordpress.org/trunk@28838 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/media-views.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/wp-includes/js/media-views.js b/src/wp-includes/js/media-views.js index f0f70e99d8..6e11970bd0 100644 --- a/src/wp-includes/js/media-views.js +++ b/src/wp-includes/js/media-views.js @@ -3492,6 +3492,13 @@ $el.hide(); } }); + + // https://core.trac.wordpress.org/ticket/27341 + _.delay( function() { + if ( '0' === $el.css('opacity') && $el.is(':visible') ) { + $el.hide(); + } + }, 500 ); } });