transfer panel: fix cancel button
This commit is contained in:
parent
36be2bb3b2
commit
881956b4f4
1 changed files with 58 additions and 46 deletions
|
@ -47,13 +47,26 @@ oml.ui.transfersPanel = function() {
|
|||
scrollbarVisible: true,
|
||||
sort: [{key: 'transferadded', operator: '-'}],
|
||||
unique: 'id'
|
||||
})
|
||||
.bindEvent({
|
||||
select: function(data) {
|
||||
$cancelButton.options({
|
||||
disabled: data.ids.length == 0,
|
||||
title: Ox._(
|
||||
data.ids.length < 2
|
||||
? 'Cancel Transfer...'
|
||||
: 'Cancel Transfers...'
|
||||
)
|
||||
});
|
||||
}
|
||||
}),
|
||||
|
||||
$item = Ox.Element(),
|
||||
|
||||
$cancelButton = Ox.Button({
|
||||
disabled: true,
|
||||
style: 'squared',
|
||||
title: 'Cancel Transfer...',
|
||||
title: Ox._('Cancel Transfer...'),
|
||||
width: 128
|
||||
})
|
||||
.css({
|
||||
|
@ -61,9 +74,8 @@ oml.ui.transfersPanel = function() {
|
|||
})
|
||||
.bindEvent({
|
||||
click: function() {
|
||||
var ids = $list.options('selected');
|
||||
ids && ids.length && oml.api.cancelDownloads({
|
||||
ids: ids
|
||||
oml.api.cancelDownloads({
|
||||
ids: $list.options('selected')
|
||||
}, function() {
|
||||
$list.reloadList(true);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue