invidious/assets/js/welcome.js
girst 8d941740c8 WIP: generalize infobox concept
instead of a single infobox only for welcome, allow multiple infoboxes
to be dismissed independently of each other.
it'd be best to use a hash or array for storing these values, but then
the state does not clear properly between sessions.
2019-09-11 23:53:51 +02:00

20 lines
567 B
JavaScript

var dismiss_welcome = document.getElementById('dismiss_welcome');
dismiss_welcome.href = 'javascript:void(0);';
dismiss_welcome.addEventListener('click', function () {
var url = '/dismiss_info?name=welcome&redirect=false';
var xhr = new XMLHttpRequest();
xhr.responseType = 'json';
xhr.timeout = 10000;
xhr.open('GET', url, true);
hide_welcome();
xhr.send();
});
function hide_welcome (bool) {
document.getElementById('feed-menu').classList.remove('hidden');
document.getElementById('welcome-outer').classList.add('hidden');
}