From b354ef7aa905f3b735e2a7e22ec6cc64d24cc1b2 Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Mon, 11 Nov 2013 16:08:23 -0800 Subject: [PATCH] Maniphest - fix a bug when selecting all tasks and then dragging them around Summary: Fixes T4006. Test Plan: clicked "select all" and dragged around tasks. Noted the task remained selected as I re-ordered, thus keeping hte count accurate. Verified when I hit "batch edit" the right tasks showed up. Reviewers: epriestley Reviewed By: epriestley CC: Korvin, epriestley, aran Maniphest Tasks: T4006 Differential Revision: https://secure.phabricator.com/D7566 --- .../application/maniphest/behavior-batch-selector.js | 12 ++++++++++++ .../maniphest/behavior-subpriorityeditor.js | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/webroot/rsrc/js/application/maniphest/behavior-batch-selector.js b/webroot/rsrc/js/application/maniphest/behavior-batch-selector.js index 6fb3d90aee..31d8da7ba6 100644 --- a/webroot/rsrc/js/application/maniphest/behavior-batch-selector.js +++ b/webroot/rsrc/js/application/maniphest/behavior-batch-selector.js @@ -41,6 +41,18 @@ JX.behavior('maniphest-batch-selector', function(config) { update(); }; + var redraw = function (task) { + var selected = is_selected(task); + change(task, selected); + }; + JX.Stratcom.listen( + 'subpriority-changed', + null, + function (e) { + e.kill(); + var data = e.getData(); + redraw(data.task); + }); // Change all tasks to some state (used by "select all" / "clear selection" // buttons). diff --git a/webroot/rsrc/js/application/maniphest/behavior-subpriorityeditor.js b/webroot/rsrc/js/application/maniphest/behavior-subpriorityeditor.js index 65052e37b4..047811e91f 100644 --- a/webroot/rsrc/js/application/maniphest/behavior-subpriorityeditor.js +++ b/webroot/rsrc/js/application/maniphest/behavior-subpriorityeditor.js @@ -57,8 +57,11 @@ JX.behavior('maniphest-subpriority-editor', function(config) { var nodes = JX.$H(r.tasks).getFragment().firstChild; var task = JX.DOM.find(nodes, 'li', 'maniphest-task'); JX.DOM.replace(node, task); - draggable.unlock(); + JX.Stratcom.invoke( + 'subpriority-changed', + null, + { 'task' : task }); }; new JX.Workflow(config.uri, data)