From 851769731a5510f11adc54df8c7b88a3cd90a083 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 12 Feb 2014 09:54:10 +0000 Subject: [PATCH] main menu: fix paste --- static/js/mainMenu.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/static/js/mainMenu.js b/static/js/mainMenu.js index be92df91..2c640798 100644 --- a/static/js/mainMenu.js +++ b/static/js/mainMenu.js @@ -424,12 +424,22 @@ pandora.ui.mainMenu = function() { ) : pandora.clipboard[action](ui.listSelection, 'item'); } else if (data.id == 'paste') { - fromMenu = true; var items = pandora.clipboard.paste(); - pandora.doHistory('paste', items, ui.section == 'items' ? ui._list : ui.edit, function() { - pandora.UI.set(ui.section == 'items' ? 'listSelection' : 'editSelection', items); - ui.section == 'items' && pandora.reloadList(); - }); + fromMenu = true; + if (ui.section == 'items') { + 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') { pandora.clipboard.clear(); } else if (data.id == 'delete') {