Fixing issue when sorting a new inserted speaker.

This commit is contained in:
FinnStutzenstein 2017-04-19 16:06:14 +02:00 committed by Emanuel Schütze
parent 09840edc0c
commit 7d1b65429e
3 changed files with 4 additions and 5 deletions

View File

@ -9,6 +9,7 @@ Version 2.2 (unreleased)
Agenda:
- Fixed wrong sorting of last speakers [#3193].
- Fixed issue when sorting a new inserted speaker [#3210].
Motions:
- New export dialog [#3185].

View File

@ -563,10 +563,8 @@ angular.module('OpenSlidesApp.agenda.site', [
// save reordered list of speakers
$scope.treeOptions = {
dropped: function (event) {
var sortedSpeakers = [];
var nextSpeakers = $filter('filter')($scope.speakers, {'begin_time': null});
angular.forEach(nextSpeakers, function (speaker) {
sortedSpeakers.push(speaker.id);
var sortedSpeakers = _.map($scope.nextSpeakers, function (speaker) {
return speaker.id;
});
$http.post('/rest/agenda/item/' + $scope.item.id + '/sort_speakers/',
{speakers: sortedSpeakers}

View File

@ -82,7 +82,7 @@
<!-- Next speakers -->
<div ng-show="nextSpeakers.length > 0">
<div ui-tree="treeOptions" data-empty-placeholder-enabled="false">
<ol ui-tree-nodes="" ng-model="speakers">
<ol ui-tree-nodes="" ng-model="nextSpeakers">
<li ng-repeat="speaker in nextSpeakers | orderBy:'weight'" ui-tree-node>
<i os-perms="agenda.can_manage" ui-tree-handle="" class="fa fa-arrows-v"></i>
{{ $index + 1 }}.