hide header on video after mouse idle
This commit is contained in:
@@ -5,21 +5,26 @@ var hyperx = require('hyperx')
|
||||
var hx = hyperx(h)
|
||||
|
||||
function Header (state, dispatch) {
|
||||
var navLeftStyle = process.platform === 'darwin'
|
||||
? {marginLeft: '78px'} /* OSX needs room on the left for min/max/close buttons */
|
||||
: null /* On Windows and Linux, the header is separate & underneath the title bar */
|
||||
var hideControls = state.url === '/player' &&
|
||||
state.video.mouseStationarySince !== 0 &&
|
||||
new Date().getTime() - state.video.mouseStationarySince > 2000
|
||||
var navLeftStyle = (process.platform === 'darwin' && !state.isFullScreen)
|
||||
? { marginLeft: '78px' } /* OSX needs room on the left for min/max/close buttons */
|
||||
: {} /* On Windows and Linux, the header is separate & underneath the title bar */
|
||||
|
||||
return hx`
|
||||
<div class='header'>
|
||||
<div class='header ${hideControls ? 'hide' : ''}'>
|
||||
${getTitle()}
|
||||
<div class='nav left' style=${navLeftStyle}>
|
||||
<i
|
||||
class='icon back'
|
||||
title='back'
|
||||
onclick=${() => dispatch('back')}>
|
||||
chevron_left
|
||||
</i>
|
||||
<i
|
||||
class='icon forward'
|
||||
title='forward'
|
||||
onclick=${() => dispatch('forward')}>
|
||||
chevron_right
|
||||
</i>
|
||||
@@ -41,6 +46,7 @@ function Header (state, dispatch) {
|
||||
return hx`
|
||||
<i
|
||||
class='icon add'
|
||||
title='add torrent'
|
||||
onclick=${() => dispatch('addTorrent')}>
|
||||
add
|
||||
</i>
|
||||
|
||||
Reference in New Issue
Block a user