Only update the moving item when moving items in worklists
This makes moving things around in boards and worklists much more sensible, by not sending a PUT request for every item in the affected worklist(s) when a single item moves. This improvement makes concurrent editing safer and less confusing. This patch requires https://review.openstack.org/273562 in order to function correctly. Change-Id: I00a98c9ac9b8c5640d8beb664b0a5a162e82b215
This commit is contained in:
@@ -207,14 +207,15 @@ angular.module('sb.worklist').controller('WorklistDetailController',
|
||||
},
|
||||
orderChanged: function (result) {
|
||||
var list = result.dest.sortableScope.$parent.worklist;
|
||||
for (var i = 0; i < list.items.length; i++) {
|
||||
var item = list.items[i];
|
||||
Worklist.ItemsController.update({
|
||||
id: list.id,
|
||||
item_id: item.id,
|
||||
list_position: i
|
||||
});
|
||||
}
|
||||
var position = result.dest.index;
|
||||
var item = list.items[position];
|
||||
|
||||
item.list_position = position;
|
||||
Worklist.ItemsController.update({
|
||||
id: list.id,
|
||||
item_id: item.id,
|
||||
list_position: item.list_position
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user