Page MenuHomePhabricator

Global upload - fix for Firefox
ClosedPublic

Authored by btrahan on Aug 1 2014, 12:31 AM.
Tags
None
Referenced Files
F14007808: D10102.id24308.diff
Tue, Oct 29, 11:52 AM
F14007807: D10102.id24299.diff
Tue, Oct 29, 11:52 AM
F14007806: D10102.id24312.diff
Tue, Oct 29, 11:52 AM
F14007805: D10102.id24311.diff
Tue, Oct 29, 11:52 AM
F14007804: D10102.id24313.diff
Tue, Oct 29, 11:52 AM
F13968456: D10102.id24299.diff
Oct 16 2024, 9:11 PM
Unknown Object (File)
Oct 7 2024, 10:15 PM
Unknown Object (File)
Oct 7 2024, 10:15 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).