diff options
| author | Mhykol <mchaeldonald62@pm.me> | 2025-02-06 04:30:17 -0500 |
|---|---|---|
| committer | Mhykol <mchaeldonald62@pm.me> | 2025-02-06 04:30:17 -0500 |
| commit | 55be526441c737142db1f2c6b31b40a0e5ca6580 (patch) | |
| tree | c29e1bb24ded444cd09086a9e1f56dff25513e93 | |
| parent | 9515b575d723e75b9b68dc9ab510d1876c9c746d (diff) | |
Added buttons in blog posts
| -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) }) |
