Refactor main.js: playback and subtitles controllers
This commit is contained in:
@@ -4,7 +4,7 @@ var hx = require('../lib/hx')
|
||||
var Header = require('./header')
|
||||
|
||||
var Views = {
|
||||
'home': require('./home'),
|
||||
'home': require('./torrent-list'),
|
||||
'player': require('./player'),
|
||||
'create-torrent': require('./create-torrent'),
|
||||
'preferences': require('./preferences')
|
||||
|
||||
@@ -519,7 +519,7 @@ function renderPlayerControls (state) {
|
||||
var windowWidth = document.querySelector('body').clientWidth
|
||||
var fraction = e.clientX / windowWidth
|
||||
var position = fraction * state.playing.duration /* seconds */
|
||||
dispatch('playbackJump', position)
|
||||
dispatch('skipTo', position)
|
||||
}
|
||||
|
||||
// Handles volume muting and Unmuting
|
||||
|
||||
@@ -153,7 +153,7 @@ function TorrentList (state) {
|
||||
<i.button-round.icon.play
|
||||
title=${playTooltip}
|
||||
class=${playClass}
|
||||
onclick=${dispatcher('play', infoHash)}>
|
||||
onclick=${dispatcher('playFile', infoHash)}>
|
||||
${playIcon}
|
||||
</i>
|
||||
`
|
||||
@@ -242,7 +242,7 @@ function TorrentList (state) {
|
||||
var handleClick
|
||||
if (isPlayable) {
|
||||
icon = 'play_arrow' /* playable? add option to play */
|
||||
handleClick = dispatcher('play', infoHash, index)
|
||||
handleClick = dispatcher('playFile', infoHash, index)
|
||||
} else {
|
||||
icon = 'description' /* file icon, opens in OS default app */
|
||||
handleClick = dispatcher('openItem', infoHash, index)
|
||||
Reference in New Issue
Block a user