From 6a66d19a2d0f94e371718d25f6abfb5f69c98a82 Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Fri, 1 Aug 2014 11:16:02 -0700 Subject: [PATCH] Global upload - fix for Firefox Summary: Fixes T5188; see task for discussion. Test Plan: made error condition occur with Firefox and was able to dismiss it by clicking 2x - once to focus window and then once to actually click in the window. Did this multiple times in a row with no errors. Reviewers: epriestley Reviewed By: epriestley Subscribers: epriestley, Korvin Maniphest Tasks: T5188 Differential Revision: https://secure.phabricator.com/D10102 --- resources/celerity/map.php | 28 +++++++++---------- webroot/rsrc/js/core/DragAndDropFileUpload.js | 14 ++++++++++ 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 43a973786d..62217f5494 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,11 +7,11 @@ */ return array( 'names' => array( - 'core.pkg.css' => 'cd8c18d3', + 'core.pkg.css' => '66ada2ec', 'core.pkg.js' => 'c3965034', 'darkconsole.pkg.js' => 'df001cab', 'differential.pkg.css' => '4a93db37', - 'differential.pkg.js' => '7528cfc9', + 'differential.pkg.js' => '79503aa4', 'diffusion.pkg.css' => '591664fa', 'diffusion.pkg.js' => 'bfc0737b', 'maniphest.pkg.css' => 'f5d89daf', @@ -105,7 +105,7 @@ return array( 'rsrc/css/application/uiexample/example.css' => '528b19de', 'rsrc/css/core/core.css' => '40151074', 'rsrc/css/core/remarkup.css' => '7fd5585f', - 'rsrc/css/core/syntax.css' => '3c18c1cb', + 'rsrc/css/core/syntax.css' => '863f3cd8', 'rsrc/css/core/z-index.css' => 'd1c137f2', 'rsrc/css/diviner/diviner-shared.css' => '38813222', 'rsrc/css/font/font-awesome.css' => '73d075c3', @@ -440,7 +440,7 @@ return array( 'rsrc/js/application/uiexample/gesture-example.js' => '558829c2', 'rsrc/js/application/uiexample/notification-example.js' => '7a9677fc', 'rsrc/js/core/Busy.js' => '6453c869', - 'rsrc/js/core/DragAndDropFileUpload.js' => '1d8ad5c3', + 'rsrc/js/core/DragAndDropFileUpload.js' => 'a575f592', 'rsrc/js/core/DraggableList.js' => '2cad29d1', 'rsrc/js/core/FileUpload.js' => 'a4ae61bf', 'rsrc/js/core/Hovercard.js' => '7e8468ae', @@ -715,7 +715,7 @@ return array( 'phabricator-countdown-css' => '86b7b0a0', 'phabricator-crumbs-view-css' => '7fbf25b8', 'phabricator-dashboard-css' => 'a2bfdcbf', - 'phabricator-drag-and-drop-file-upload' => '1d8ad5c3', + 'phabricator-drag-and-drop-file-upload' => 'a575f592', 'phabricator-draggable-list' => '2cad29d1', 'phabricator-fatal-config-template-css' => '25d446d6', 'phabricator-feed-css' => '4e544db4', @@ -827,7 +827,7 @@ return array( 'sprite-payments-css' => 'cc085d44', 'sprite-projects-css' => '7578fa56', 'sprite-tokens-css' => '1706b943', - 'syntax-highlighting-css' => '3c18c1cb', + 'syntax-highlighting-css' => '863f3cd8', 'tokens-css' => '3d0f239e', ), 'requires' => array( @@ -959,14 +959,6 @@ return array( 'javelin-util', 'phabricator-keyboard-shortcut-manager', ), - '1d8ad5c3' => array( - 'javelin-install', - 'javelin-util', - 'javelin-request', - 'javelin-dom', - 'javelin-uri', - 'phabricator-file-upload', - ), '1def2711' => array( 'javelin-install', 'javelin-dom', @@ -1498,6 +1490,14 @@ return array( 'javelin-stratcom', 'javelin-vector', ), + 'a575f592' => array( + 'javelin-install', + 'javelin-util', + 'javelin-request', + 'javelin-dom', + 'javelin-uri', + 'phabricator-file-upload', + ), 'a5b67173' => array( 'javelin-dom', 'javelin-util', diff --git a/webroot/rsrc/js/core/DragAndDropFileUpload.js b/webroot/rsrc/js/core/DragAndDropFileUpload.js index efe7a06dca..0787ac30ea 100644 --- a/webroot/rsrc/js/core/DragAndDropFileUpload.js +++ b/webroot/rsrc/js/core/DragAndDropFileUpload.js @@ -66,6 +66,20 @@ JX.install('PhabricatorDragAndDropFileUpload', { return false; } + // Firefox has some issues sometimes; implement this click handler so + // the user can recover. See T5188. + JX.DOM.listen( + this._node, + 'click', + null, + JX.bind(this, function (e) { + if (this._depth) { + e.kill(); + // Force depth to 0. + this._updateDepth(-this._depth); + } + })); + // We track depth so that the _node may have children inside of it and // not become unselected when they are dragged over. JX.DOM.listen(