on edit sort can change, clear cache and sort clips after editing

This commit is contained in:
j 2014-02-13 09:32:14 +00:00
parent d8499cb8de
commit ccb4a13569

View file

@ -160,6 +160,7 @@ pandora.ui.editPanel = function(isEmbed) {
pandora.clipboard.copy(clips, 'clip'); pandora.clipboard.copy(clips, 'clip');
pandora.doHistory('cut', clips, ui.edit, function(result) { pandora.doHistory('cut', clips, ui.edit, function(result) {
Ox.Request.clearCache('getEdit'); Ox.Request.clearCache('getEdit');
Ox.Request.clearCache('sortClips');
updateClips(result.data.clips); updateClips(result.data.clips);
}); });
}, },
@ -168,6 +169,7 @@ pandora.ui.editPanel = function(isEmbed) {
pandora.clipboard.add(clips, 'clip'); pandora.clipboard.add(clips, 'clip');
pandora.doHistory('cut', clips, ui.edit, function(result) { pandora.doHistory('cut', clips, ui.edit, function(result) {
Ox.Request.clearCache('getEdit'); Ox.Request.clearCache('getEdit');
Ox.Request.clearCache('sortClips');
updateClips(result.data.clips); updateClips(result.data.clips);
}); });
}, },
@ -175,6 +177,7 @@ pandora.ui.editPanel = function(isEmbed) {
var clips = serializeClips(data.ids); var clips = serializeClips(data.ids);
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');
updateClips(result.data.clips); updateClips(result.data.clips);
}); });
}, },
@ -198,9 +201,9 @@ pandora.ui.editPanel = function(isEmbed) {
out: data.key == 'out' ? data.value : clip.out out: data.key == 'out' ? data.value : clip.out
}])); }]));
pandora.doHistory('edit', clips, ui.edit, function(result) { pandora.doHistory('edit', clips, ui.edit, function(result) {
edit.clips[index] = result.data; edit.clips[Ox.getIndexById(edit.clips, data.id)] = result.data;
that.updateClip(data.id, result.data); Ox.Request.clearCache('sortClips');
updateVideos(); sortClips(updateClips);
}); });
}); });
}, },
@ -221,6 +224,7 @@ pandora.ui.editPanel = function(isEmbed) {
ids: data.ids ids: data.ids
}, function(result) { }, function(result) {
Ox.Request.clearCache('getEdit'); Ox.Request.clearCache('getEdit');
Ox.Request.clearCache('sortClips');
orderClips(data.ids); orderClips(data.ids);
}); });
}, },
@ -251,6 +255,7 @@ pandora.ui.editPanel = function(isEmbed) {
var clips = pandora.clipboard.paste(); var clips = pandora.clipboard.paste();
pandora.doHistory('paste', clips, ui.edit, function(result) { pandora.doHistory('paste', clips, ui.edit, function(result) {
Ox.Request.clearCache('getEdit'); Ox.Request.clearCache('getEdit');
Ox.Request.clearCache('sortClips');
updateClips(edit.clips.map(function(clip) { updateClips(edit.clips.map(function(clip) {
if (clip.index >= result.data.clips[0].index) { if (clip.index >= result.data.clips[0].index) {
clip.index += result.data.clips.length clip.index += result.data.clips.length
@ -342,6 +347,7 @@ pandora.ui.editPanel = function(isEmbed) {
}); });
that.updatePanel = function(callback) { that.updatePanel = function(callback) {
Ox.Request.clearCache('getEdit'); Ox.Request.clearCache('getEdit');
Ox.Request.clearCache('sortClips');
getEdit(function() { getEdit(function() {
updateClips(); updateClips();
callback && callback(); callback && callback();