pomodoro/client/app.js
2016-09-15 11:33:57 +02:00

23 lines
486 B
JavaScript

import { $ } from 'dollr'
import './process'
import Timer from './components/Timer'
// request permission on page load
document.addEventListener('DOMContentLoaded', () => {
if (!Notification) {
alert('Desktop notifications not available in your browser. Try Chromium, Chrome or Firefox.')
return
}
if (Notification.permission !== 'granted')
Notification.requestPermission()
})
$(() => {
const timer = $('.timer')
Timer.render().replace(timer).getWidget()
})