list.js: handle copy/paste

This commit is contained in:
rolux 2013-07-13 23:01:17 +00:00 committed by j
parent f122fb5327
commit 70f4037172

View file

@ -393,12 +393,7 @@ pandora.ui.list = function() {
//delete pandora.$ui.previewDialog; //delete pandora.$ui.previewDialog;
}, },
copy: function(data) { copy: function(data) {
Ox.Clipboard.copy({ Ox.Clipboard.copy(data.ids, 'item');
items: data.ids,
text: data.ids.map(function(id) {
return pandora.$ui.list.value(id, 'title');
}).join('\n')
});
}, },
'delete': function(data) { 'delete': function(data) {
pandora.getListData().editable && pandora.api.removeListItems({ pandora.getListData().editable && pandora.api.removeListItems({
@ -529,10 +524,14 @@ pandora.ui.list = function() {
}); });
}, },
paste: function(data) { paste: function(data) {
data.items && pandora.getListData().editable && pandora.api.addListItems({ var items;
if (Ox.Clipboard.type() == 'item') {
items = Ox.Clipboard.paste();
items.length && pandora.getListData().editable && pandora.api.addListItems({
list: pandora.user.ui._list, list: pandora.user.ui._list,
items: data.items items: items
}, pandora.reloadList); }, pandora.reloadList);
}
}, },
select: function(data) { select: function(data) {
var query; var query;