From 1b269189b7919ed00e25320fc9f13ddff04c89c7 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 5 Mar 2016 19:20:17 -0800 Subject: [PATCH 1/2] no need for '|| 0' --- renderer/views/torrent-list.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/renderer/views/torrent-list.js b/renderer/views/torrent-list.js index 83e72755..59de9e20 100644 --- a/renderer/views/torrent-list.js +++ b/renderer/views/torrent-list.js @@ -46,9 +46,9 @@ function renderTorrent (torrent, dispatch) { // Renders the torrent name and download progress function renderTorrentMetadata (torrent) { - var progress = Math.floor(100 * (torrent.progress || 0)) - var downloaded = prettyBytes(torrent.downloaded || 0) - var total = prettyBytes(torrent.length || 0) + var progress = Math.floor(100 * torrent.progress) + var downloaded = prettyBytes(torrent.downloaded) + var total = prettyBytes(torrent.ready ? torrent.length : 0) if (downloaded !== total) downloaded += ` / ${total}` From 52427dd18341db3aa78c289b0e8d84d67af17d01 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 5 Mar 2016 19:24:42 -0800 Subject: [PATCH 2/2] Hide player controls when mouse is still, even when not fullscreened (fix #37) --- renderer/index.js | 2 +- renderer/views/player.js | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/renderer/index.js b/renderer/index.js index 77677080..7765610b 100644 --- a/renderer/index.js +++ b/renderer/index.js @@ -208,7 +208,7 @@ function dispatch (action, ...args) { if (action === 'toggleFullScreen') { electron.ipcRenderer.send('toggleFullScreen') } - if (action === 'fullscreenVideoMouseMoved') { + if (action === 'videoMouseMoved') { state.video.mouseStationarySince = new Date().getTime() } } diff --git a/renderer/views/player.js b/renderer/views/player.js index 8e8191c6..93bbff78 100644 --- a/renderer/views/player.js +++ b/renderer/views/player.js @@ -24,14 +24,17 @@ function Player (state, dispatch) { } // When in fullscreen, hide player controls if the mouse stays still for a while - var hideControls = state.isFullScreen && - state.video.mouseStationarySince !== 0 && + var hideControls = state.video.mouseStationarySince !== 0 && new Date().getTime() - state.video.mouseStationarySince > 2000 // Show the video as large as will fit in the window, play immediately return hx` -
-
+
dispatch('videoMouseMoved')}> +
dispatch('videoMouseMoved')}>