let shown = false
let hideTimeout
const ipc = require('electron').ipcRenderer;
let showCount = 0
if (process.versions.hasOwnProperty('electron')) {
p3x.onenote.ui.overlay = new function() {
const template = (options = {}) => {
return `
${options.hasOwnProperty('message') ? "
" : ''}
${options.hasOwnProperty('message') ? options.message : ''}
`
}
this.show = (options = {}) => {
/*
ipc.send('p3x-debug', {
'overlay show': shown,
})
*/
showCount++
if (showCount > 5) {
require('../action/multi-actions')({
action: 'home'
})
this.hide()
}
if (shown) {
return
}
shown = true
///this.hide()
//console.warn('p3xr.ui.overlay show')
$body.append(template(options))
}
this.hide = () => {
/*
ipc.send('p3x-debug', {
'overlay hide': 'done',
})
*/
//console.warn('p3xr.ui.overlay hide')
$body.find('#p3xr-overlay').remove()
shown = false
}
}
}