'use strict'
/*
Open Rowing Monitor, https://github.com/laberning/openrowingmonitor
Component that renders the action buttons of the dashboard
*/
import { AppElement, html, css } from './AppElement'
import { customElement, property } from 'lit/decorators.js'
import { icon_undo, icon_expand, icon_compress, icon_poweroff, icon_bluetooth } from '../lib/icons'
@customElement('dashboard-actions')
export class DashboardActions extends AppElement {
static get styles () {
return css`
`
}
@property({ type: String })
peripheralMode = ''
render () {
return html`
${this.appState.peripheralMode}
`
}
// ${this.peripheralMode}
toggleFullscreen () {
const fullscreenElement = document.getElementsByTagName('web-app')[0]
if (!document.fullscreenElement) {
fullscreenElement.requestFullscreen({ navigationUI: 'hide' })
} else {
if (document.exitFullscreen) {
document.exitFullscreen()
}
}
}
close () {
window.close()
}
reset () {
this.sendEvent('triggerAction', { command: 'reset' })
}
switchPeripheralMode () {
// todo: this is just a test property to see if the concept works...
// this.appState.peripheralMode = 'PM5'
// this.updateState()
this.sendEvent('triggerAction', { command: 'switchPeripheralMode' })
}
}