list.js: only editable _and static_ list allow for remove; on paste, select pasted items; remove main menu update on select (belongs in main menu)
This commit is contained in:
parent
b16ee88a68
commit
8850153909
1 changed files with 14 additions and 15 deletions
|
@ -398,13 +398,16 @@ pandora.ui.list = function() {
|
||||||
Ox.Clipboard.add(data.ids, 'item');
|
Ox.Clipboard.add(data.ids, 'item');
|
||||||
},
|
},
|
||||||
'delete': function(data) {
|
'delete': function(data) {
|
||||||
pandora.getListData().editable && pandora.api.removeListItems({
|
var listData = pandora.getListData();
|
||||||
|
if (listData.editable && listData.type == 'static') {
|
||||||
|
pandora.api.removeListItems({
|
||||||
list: pandora.user.ui._list,
|
list: pandora.user.ui._list,
|
||||||
items: data.ids
|
items: data.ids
|
||||||
}, function() {
|
}, function() {
|
||||||
pandora.UI.set({listSelection: []});
|
pandora.UI.set({listSelection: []});
|
||||||
pandora.reloadList();
|
pandora.reloadList();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
init: function(data) {
|
init: function(data) {
|
||||||
var folder, list;
|
var folder, list;
|
||||||
|
@ -461,19 +464,15 @@ pandora.ui.list = function() {
|
||||||
items.length && pandora.getListData().editable && pandora.api.addListItems({
|
items.length && pandora.getListData().editable && pandora.api.addListItems({
|
||||||
list: pandora.user.ui._list,
|
list: pandora.user.ui._list,
|
||||||
items: items
|
items: items
|
||||||
}, pandora.reloadList);
|
}, function() {
|
||||||
|
pandora.UI.set({listSelection: items});
|
||||||
|
pandora.reloadList();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
select: function(data) {
|
select: function(data) {
|
||||||
var query;
|
var query;
|
||||||
pandora.UI.set('listSelection', data.ids);
|
pandora.UI.set('listSelection', data.ids);
|
||||||
if (data.ids.length) {
|
|
||||||
pandora.$ui.mainMenu.enableItem('copy');
|
|
||||||
pandora.$ui.mainMenu.enableItem('openmovie');
|
|
||||||
} else {
|
|
||||||
pandora.$ui.mainMenu.disableItem('copy');
|
|
||||||
pandora.$ui.mainMenu.disableItem('openmovie');
|
|
||||||
}
|
|
||||||
if (data.ids.length == 0) {
|
if (data.ids.length == 0) {
|
||||||
pandora.$ui.statusbar.set('selected', {items: 0});
|
pandora.$ui.statusbar.set('selected', {items: 0});
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue