diff options
| -rw-r--r-- | assets/js/blogitem.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/assets/js/blogitem.js b/assets/js/blogitem.js index 9ed188d..3155ef9 100644 --- a/assets/js/blogitem.js +++ b/assets/js/blogitem.js @@ -65,6 +65,13 @@ class BlogItem { <div class='navright'>»</div> ` + this.buttons = document.querySelectorAll('button[value]') + this.buttons.forEach(button => { + button.addEventListener('click', () => { + window.location.href = window.location.origin + button.value + }) + }) + this.object.content.style.opacity = 0 this.object.images.forEach((img, index) => { img.addEventListener('click', () => { @@ -91,7 +98,7 @@ class BlogItem { } #RemoveTag() { this.object['images'] = document.querySelectorAll('img:not([class])') - this.object.images.forEach((img, index) => { + this.object.images.forEach(img => { const p = img.parentElement if (p.tagName === 'P') p.replaceWith(img) }) |
