mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-06-13 02:39:23 +00:00
18 lines
530 B
JavaScript
18 lines
530 B
JavaScript
// set javascript listeners
|
|
function updateDisplay(e) {
|
|
// used in set reading goal
|
|
var key = e.target.getAttribute('data-id');
|
|
var value = e.target.getAttribute('data-value');
|
|
window.localStorage.setItem(key, value);
|
|
|
|
document.querySelectorAll('[data-hide="' + key + '"]')
|
|
.forEach(t => setDisplay(t));
|
|
}
|
|
|
|
function setDisplay(el) {
|
|
// used in set reading goal
|
|
var key = el.getAttribute('data-hide');
|
|
var value = window.localStorage.getItem(key);
|
|
addRemoveClass(el, 'hidden', value);
|
|
}
|