;
}
public createToolbarButton(): HTMLButtonElement {
// add a button to the app that toggles the splash and setup to add to the view
const splashButton = document.createElement('button');
splashButton.setAttribute('data-modal', this.modalId);
splashButton.setAttribute('title', i18n.widgets.splash.tooltip);
const headerButtonClasses = [
CSS.modaltoggle,
CSS.button,
'share-toggle',
'esri-component',
'esri-widget--button',
'icon-ui-flush',
'icon-ui-description'
];
splashButton.classList.add(...headerButtonClasses);
/*åsplashButton.addEventListener("click", () => {
calcite.bus.on("modal:open", () => {
console.log("Opened focus should be trapped")
});
});*/
calcite.bus.on('modal:close', () => {
splashButton.focus();
});
calcite.bus.on('modal:open', () => {
// need to fix focus issue
});
return splashButton;
}
public showSplash() {
calcite.init();
if (this.config.splashOnStart) {
// enable splash screen when app loads then
// set info in session storage when its closed
// so we don't open again this session.
if (!sessionStorage.getItem('disableSplash')) {
calcite.bus.emit('modal:open', { id: this.modalId });
}
sessionStorage.setItem('disableSplash', 'true');
}
}
}
export default Splash;