sort clips after delete, fixes #2718

This commit is contained in:
j 2015-04-02 13:56:00 +02:00
parent 083fabc208
commit 12adaf062a

View file

@ -183,7 +183,8 @@ pandora.ui.editPanel = function(isEmbed) {
pandora.doHistory('delete', clips, ui.edit, function(result) { pandora.doHistory('delete', clips, ui.edit, function(result) {
Ox.Request.clearCache('getEdit'); Ox.Request.clearCache('getEdit');
Ox.Request.clearCache('sortClips'); Ox.Request.clearCache('sortClips');
updateClips(result.data.clips); edit.clips = result.data.clips;
sortClips(updateClips);
}); });
}, },
edit: function(data) { edit: function(data) {
@ -215,9 +216,10 @@ pandora.ui.editPanel = function(isEmbed) {
join: function(data) { join: function(data) {
var clips = [serializeClips(data.ids), serializeClips(data.join)]; var clips = [serializeClips(data.ids), serializeClips(data.join)];
pandora.doHistory('join', clips, ui.edit, function(result) { pandora.doHistory('join', clips, ui.edit, function(result) {
updateClips(edit.clips.filter(function(clip) { edit.clips = edit.clips.filter(function(clip) {
return !Ox.contains(data.ids, clip.id); return !Ox.contains(data.ids, clip.id);
}).concat(result.data.clips)); }).concat(result.data.clips);
sortClips(updateClips);
}); });
}, },
loop: function(data) { loop: function(data) {