Page MenuHomePhabricator

Global upload - fix for Firefox
ClosedPublic

Authored by btrahan on Aug 1 2014, 12:31 AM.
Tags
None
Referenced Files
F13393026: D10102.diff
Tue, Jul 2, 8:55 PM
F13389885: D10102.id24311.diff
Mon, Jul 1, 11:05 PM
F13386204: D10102.id24308.diff
Mon, Jul 1, 4:48 AM
F13371832: D10102.id.diff
Fri, Jun 28, 5:32 AM
F13368556: D10102.id24312.diff
Thu, Jun 27, 7:03 AM
F13363517: D10102.id24299.diff
Wed, Jun 26, 3:44 AM
F13362455: D10102.id24313.diff
Tue, Jun 25, 9:26 PM
F13362130: D10102.diff
Tue, Jun 25, 6:31 PM
Subscribers

Details

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.

Diff Detail

Repository
rP Phabricator
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

btrahan retitled this revision from to Global upload - fix for Firefox.
btrahan updated this object.
btrahan edited the test plan for this revision. (Show Details)
btrahan added a reviewer: epriestley.
webroot/rsrc/js/core/behavior-global-drag-and-drop.js
45 ↗(On Diff #24299)

This calls a private (underscore) method of another class. Can JX.PhabricatorDragAndDropFileUpload handle this instead?

That is, just implement the "clicking the drop target cancels an ongoing drag" for all drop targets.

Okay, I'll try that. I figured it belonged in the "global" behavior that uses the core bit since this doesn't make sense for non-global drag and drops. I think if its implemented generally though it will cause no actual problems.

btrahan edited edge metadata.

put it in the core behavior so we aren't abusing private methods

also update celerity map

epriestley edited edge metadata.
epriestley added inline comments.
webroot/rsrc/js/core/DragAndDropFileUpload.js
75

Just remove e so the signature is function ().

I like these "documentation" parameters, but enabling this rule caught at least a handful of real errors (variables which were declared/assigned but not used) and getting those actual issues cleaned up seemed worth getting yelled at about these sort-of-nice-to-have-but-not-technically-necessary parameters.

Ideally we'd detect the other stuff but ignore these, but we'd have to fork jshint to support that.

Or maybe add e.kill(), it seems like we should be swallowing these events? Maybe like:

if (this._depth) {
  e.kill();
  this._updateDepth(...);
}
This revision is now accepted and ready to land.Aug 1 2014, 5:56 PM
btrahan edited edge metadata.

do the e.kill() version. also add a '_dragging' member variable, cuz this 'click' handler should do absolutely nothing if / when we are not dragging.

missed the this._depth tip. kill _dragging variable and just use _depth. re-tested and its good

btrahan updated this revision to Diff 24313.

Closed by commit rP6a66d19a2d0f (authored by @btrahan).