Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 6cd94c3

Browse files
committed
Merge pull request #7820 from adobe/tom/workingset-dnd-fixes
Allow the user to drag faster
2 parents b085aee + 940fb10 commit 6cd94c3

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/project/WorkingSetView.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ define(function (require, exports, module) {
245245
interval = false,
246246
moved = false;
247247

248+
// Don't redraw the working set for the next events
249+
_suppressSortRedraw = true;
250+
248251
function drag(e) {
249252
var top = e.pageY - startPageY;
250253

@@ -304,9 +307,6 @@ define(function (require, exports, module) {
304307
if (!moved && Math.abs(top) > 3) {
305308
Menus.closeAll();
306309
moved = true;
307-
308-
// Don't redraw the working set for the next events
309-
_suppressSortRedraw = true;
310310
}
311311
}
312312

@@ -377,10 +377,10 @@ define(function (require, exports, module) {
377377
if (addBottomShadow) {
378378
ViewUtils.addScrollerShadow($openFilesContainer[0], null, true);
379379
}
380-
381-
// The drag is done, so set back to the default
382-
_suppressSortRedraw = false;
383380
}
381+
382+
// The drag is done, so set back to the default
383+
_suppressSortRedraw = false;
384384
}
385385

386386

@@ -398,16 +398,17 @@ define(function (require, exports, module) {
398398

399399
// Style the element
400400
$listItem.css("position", "relative").css("z-index", 1);
401-
401+
402402
// Envent Handlers
403-
$openFilesContainer.on("mousemove.workingSet", function (e) {
403+
var $holder = $(window);
404+
$holder.on("mousemove.workingSet", function (e) {
404405
if (hasScroll) {
405406
scroll(e);
406407
}
407408
drag(e);
408409
});
409-
$openFilesContainer.on("mouseup.workingSet mouseleave.workingSet", function (e) {
410-
$openFilesContainer.off("mousemove.workingSet mouseup.workingSet mouseleave.workingSet");
410+
$holder.on("mouseup.workingSet", function (e) {
411+
$holder.off(".workingSet");
411412
drop();
412413
});
413414
}

0 commit comments

Comments
 (0)