Torrent list bug: don't [un]select torrent when clicking download or play button
This commit is contained in:
@@ -103,20 +103,26 @@ function renderTorrentButtons (torrentSummary, dispatch) {
|
|||||||
<div class='buttons'>
|
<div class='buttons'>
|
||||||
<i.btn.icon.download
|
<i.btn.icon.download
|
||||||
class='${torrentSummary.status}'
|
class='${torrentSummary.status}'
|
||||||
onclick=${() => dispatch('toggleTorrent', torrentSummary)}>
|
onclick=${(e) => handleButton('toggleTorrent', e)}>
|
||||||
${torrentSummary.status === 'seeding' ? 'file_upload' : 'file_download'}
|
${torrentSummary.status === 'seeding' ? 'file_upload' : 'file_download'}
|
||||||
</i>
|
</i>
|
||||||
<i.btn.icon.play
|
<i.btn.icon.play
|
||||||
onclick=${() => dispatch('openPlayer', torrentSummary)}>
|
onclick=${(e) => handleButton('openPlayer', e)}>
|
||||||
${torrentSummary.playStatus === 'timeout' ? 'warning' : 'play_arrow'}
|
${torrentSummary.playStatus === 'timeout' ? 'warning' : 'play_arrow'}
|
||||||
</i>
|
</i>
|
||||||
<i
|
<i
|
||||||
class='icon delete'
|
class='icon delete'
|
||||||
onclick=${() => dispatch('deleteTorrent', torrentSummary)}>
|
onclick=${(e) => handleButton('deleteTorrent', e)}>
|
||||||
close
|
close
|
||||||
</i>
|
</i>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
|
|
||||||
|
function handleButton (action, e) {
|
||||||
|
// Prevent propagation so that we don't select/unselect the torrent
|
||||||
|
e.stopPropagation()
|
||||||
|
dispatch(action, torrentSummary)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show files, per-file download status and play buttons, and so on
|
// Show files, per-file download status and play buttons, and so on
|
||||||
|
|||||||
Reference in New Issue
Block a user