fixed js style

This commit is contained in:
Alberto Miranda
2016-06-24 00:57:33 -03:00
parent a4fa9ac666
commit f071965ae8
2 changed files with 9 additions and 16 deletions

View File

@@ -59,10 +59,6 @@ function onToggleFullScreen (flag) {
getMenuItem('Full Screen').checked = flag getMenuItem('Full Screen').checked = flag
} }
function onToggleOpenInVlc (flag) {
getMenuItem('Open in VLC').checked = flag
}
function onWindowBlur () { function onWindowBlur () {
getMenuItem('Full Screen').enabled = false getMenuItem('Full Screen').enabled = false
getMenuItem('Float on Top').enabled = false getMenuItem('Float on Top').enabled = false

View File

@@ -151,14 +151,14 @@ function updateElectron () {
} }
} }
function toggleOpenInVlc(menuItem) { function toggleOpenInVlc (menuItem) {
var flag = menuItem.checked; var flag = menuItem.checked
console.log(`toggleOpenInVlc ${flag}`); console.log(`toggleOpenInVlc ${flag}`)
config.OPEN_IN_VLC = flag; config.OPEN_IN_VLC = flag
} }
function getOpenInVlc() { function getOpenInVlc () {
return config.OPEN_IN_VLC; return config.OPEN_IN_VLC
} }
// Events from the UI never modify state directly. Instead they call dispatch() // Events from the UI never modify state directly. Instead they call dispatch()
@@ -167,9 +167,8 @@ function dispatch (action, ...args) {
if (!['mediaMouseMoved', 'mediaTimeUpdate'].includes(action)) { if (!['mediaMouseMoved', 'mediaTimeUpdate'].includes(action)) {
console.log('dispatch: %s %o', action, args) console.log('dispatch: %s %o', action, args)
} }
if (action === 'toggleOpenInVlc') { if (action === 'toggleOpenInVlc') {
toggleOpenInVlc(args[0]); toggleOpenInVlc(args[0])
} }
if (action === 'onOpen') { if (action === 'onOpen') {
onOpen(args[0] /* files */) onOpen(args[0] /* files */)
@@ -1074,16 +1073,14 @@ function openPlayerFromActiveTorrent (torrentSummary, index, timeout, cb) {
return update() return update()
} }
//------------------------------------------------------
// play in VLC if set as default player (Menu: Playback / Open in VLC) // play in VLC if set as default player (Menu: Playback / Open in VLC)
if (getOpenInVlc()) { if (getOpenInVlc()) {
console.log('-- OPEN IN VLC', torrentSummary); console.log('-- OPEN IN VLC', torrentSummary)
dispatch('vlcPlay'); dispatch('vlcPlay')
update() update()
cb() cb()
return; return;
} }
//------------------------------------------------------
// otherwise, play the video // otherwise, play the video
state.window.title = torrentSummary.files[state.playing.fileIndex].name state.window.title = torrentSummary.files[state.playing.fileIndex].name