- $('body').addEventListener('click', e => {
- const actions = e.target.getAttribute('data-actions');
- if(actions && actions.split(' ').includes('activate')) {
- activeMarker(e);
- }
- if (e.target.classList.contains('unread') && e.target.getAttribute('data-feed-item-id') !== null) {
- e.target.classList.remove('unread');
- // ok it was unread.. so we should figure out the id that it belongs
- // to and decr the counter for that!
- const feedId = e.target.getAttribute('data-feed-id');
- const el = $(`#feed-list a[data-feed-id="${feedId}"] .unread-count`);
- if(el) {
- if(el.innerHTML.length) {
- let count = parseInt(el.innerHTML.split('(')[1].split(')')[0]);
- count--;
- if(count < 1) {
- el.innerHTML = '';
- el.parentElement.classList.remove('unread');
- }
- else {
- el.innerHTML = `(${count})`;
- }
- }
+$('body').addEventListener('click', e => {
+ const actions = e.target.getAttribute('data-actions');
+ if(actions && actions.split(' ').includes('activate')) {
+ activeMarker(e);
+ }
+ if (e.target.classList.contains('unread') && e.target.getAttribute('data-feed-item-id') !== null) {
+ e.target.classList.remove('unread');
+ // ok it was unread.. so we should figure out the id that it belongs
+ // to and decr the counter for that!
+ const feedId = e.target.getAttribute('data-feed-id');
+ const el = $(`#feed-list a[data-feed-id="${feedId}"] .unread-count`);
+ if(el) {
+ if(el.innerHTML.length) {
+ let count = parseInt(el.innerHTML.split('(')[1].split(')')[0]);
+ count--;
+ if(count < 1) {
+ el.innerHTML = '';
+ el.parentElement.classList.remove('unread');
+ }
+ else {
+ el.innerHTML = `(${count})`;