From 70f403717214f4a85ba3a74e77c380df63236627 Mon Sep 17 00:00:00 2001 From: rolux Date: Sat, 13 Jul 2013 23:01:17 +0000 Subject: [PATCH] list.js: handle copy/paste --- static/js/pandora/list.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/static/js/pandora/list.js b/static/js/pandora/list.js index cdfb5d15b..ad76cf061 100644 --- a/static/js/pandora/list.js +++ b/static/js/pandora/list.js @@ -393,12 +393,7 @@ pandora.ui.list = function() { //delete pandora.$ui.previewDialog; }, copy: function(data) { - Ox.Clipboard.copy({ - items: data.ids, - text: data.ids.map(function(id) { - return pandora.$ui.list.value(id, 'title'); - }).join('\n') - }); + Ox.Clipboard.copy(data.ids, 'item'); }, 'delete': function(data) { pandora.getListData().editable && pandora.api.removeListItems({ @@ -529,10 +524,14 @@ pandora.ui.list = function() { }); }, paste: function(data) { - data.items && pandora.getListData().editable && pandora.api.addListItems({ - list: pandora.user.ui._list, - items: data.items - }, pandora.reloadList); + var items; + if (Ox.Clipboard.type() == 'item') { + items = Ox.Clipboard.paste(); + items.length && pandora.getListData().editable && pandora.api.addListItems({ + list: pandora.user.ui._list, + items: items + }, pandora.reloadList); + } }, select: function(data) { var query;