U4-3667 - 7.0.0 - Bug with multiple media picker drag n' drop sorting

Created by A C 22 Nov 2013, 02:31:31 Updated by Shannon Deminick 21 Jun 2017, 07:58:45

Issue:

When dragging and dropping to sort the order of media files in a multiple media picker property, all ids get wiped.

Source of problem:

umbraco.controller.js:4139

  • Wrong callback being called
    • see https://github.com/angular-ui/ui-sortable
      • Note: update occurs before any model/scope changes but after the DOM position has been updated. So ui.item.scope and the directive's ng-model, are equal to the scope before the drag start.
  • $scope.renderModel should be $scope.images

Solution:

$scope.sortableOptions = { stop: function(e, ui) { var r = []; angular.forEach($scope.images, function(value, key){ r.push(value.id); }); $scope.ids = r; $scope.sync(); } };

Comments

Shannon Deminick 21 Jun 2017, 07:58:46

Closing issue due to inactivity - see blog post for details https://umbraco.com/blog/issue-tracker-cleanup/


Priority: Normal

Type: Bug

State: Closed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.0.0

Due in version:

Sprint:

Story Points:

Cycle: