main menu: fix paste

This commit is contained in:
rolux 2014-02-12 09:54:10 +00:00
parent 06a7ed425b
commit 851769731a

View file

@ -424,12 +424,22 @@ pandora.ui.mainMenu = function() {
) )
: pandora.clipboard[action](ui.listSelection, 'item'); : pandora.clipboard[action](ui.listSelection, 'item');
} else if (data.id == 'paste') { } else if (data.id == 'paste') {
fromMenu = true;
var items = pandora.clipboard.paste(); var items = pandora.clipboard.paste();
pandora.doHistory('paste', items, ui.section == 'items' ? ui._list : ui.edit, function() { fromMenu = true;
pandora.UI.set(ui.section == 'items' ? 'listSelection' : 'editSelection', items); if (ui.section == 'items') {
ui.section == 'items' && pandora.reloadList(); pandora.doHistory('paste', items, ui._list, function() {
pandora.UI.set({listSelection: items});
pandora.reloadList();
}); });
} else {
pandora.doHistory('paste', items, ui.edit, function(result) {
pandora.$ui.editPanel.updatePanel(function() {
pandora.UI.set({editSelection: result.data.clips.map(function(clip) {
return clip.id;
})});
});
});
}
} else if (data.id == 'clearclipboard') { } else if (data.id == 'clearclipboard') {
pandora.clipboard.clear(); pandora.clipboard.clear();
} else if (data.id == 'delete') { } else if (data.id == 'delete') {