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
}
function onToggleOpenInVlc (flag) {
getMenuItem('Open in VLC').checked = flag
}
function onWindowBlur () {
getMenuItem('Full Screen').enabled = false
getMenuItem('Float on Top').enabled = false

View File

@@ -151,14 +151,14 @@ function updateElectron () {
}
}
function toggleOpenInVlc(menuItem) {
var flag = menuItem.checked;
console.log(`toggleOpenInVlc ${flag}`);
config.OPEN_IN_VLC = flag;
function toggleOpenInVlc (menuItem) {
var flag = menuItem.checked
console.log(`toggleOpenInVlc ${flag}`)
config.OPEN_IN_VLC = flag
}
function getOpenInVlc() {
return config.OPEN_IN_VLC;
function getOpenInVlc () {
return config.OPEN_IN_VLC
}
// 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)) {
console.log('dispatch: %s %o', action, args)
}
if (action === 'toggleOpenInVlc') {
toggleOpenInVlc(args[0]);
toggleOpenInVlc(args[0])
}
if (action === 'onOpen') {
onOpen(args[0] /* files */)
@@ -1074,16 +1073,14 @@ function openPlayerFromActiveTorrent (torrentSummary, index, timeout, cb) {
return update()
}
//------------------------------------------------------
// play in VLC if set as default player (Menu: Playback / Open in VLC)
if (getOpenInVlc()) {
console.log('-- OPEN IN VLC', torrentSummary);
dispatch('vlcPlay');
console.log('-- OPEN IN VLC', torrentSummary)
dispatch('vlcPlay')
update()
cb()
return;
}
//------------------------------------------------------
// otherwise, play the video
state.window.title = torrentSummary.files[state.playing.fileIndex].name