From ca2236da844405a0d67efcb671e59c745b337306 Mon Sep 17 00:00:00 2001 From: DC Date: Fri, 11 Mar 2016 16:06:11 -0800 Subject: [PATCH] Torrent list bug: don't [un]select torrent when clicking download or play button --- renderer/views/torrent-list.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/renderer/views/torrent-list.js b/renderer/views/torrent-list.js index 90ef21c9..fa739d36 100644 --- a/renderer/views/torrent-list.js +++ b/renderer/views/torrent-list.js @@ -103,20 +103,26 @@ function renderTorrentButtons (torrentSummary, dispatch) {
dispatch('toggleTorrent', torrentSummary)}> + onclick=${(e) => handleButton('toggleTorrent', e)}> ${torrentSummary.status === 'seeding' ? 'file_upload' : 'file_download'} dispatch('openPlayer', torrentSummary)}> + onclick=${(e) => handleButton('openPlayer', e)}> ${torrentSummary.playStatus === 'timeout' ? 'warning' : 'play_arrow'} dispatch('deleteTorrent', torrentSummary)}> + onclick=${(e) => handleButton('deleteTorrent', e)}> close
` + + 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