diff options
| author | 8chan <admin@8chan.co> | 2014-06-10 18:00:49 +0000 |
|---|---|---|
| committer | Fredrick Brennan <admin@8chan.co> | 2014-06-10 18:18:14 +0000 |
| commit | dfe8ddc34000685f5deaf504ffe78e8dd685681c (patch) | |
| tree | 26709ca0e3d2d1576edbdac8135de1ebeda54fa2 /js/inline-expanding.js | |
| parent | e27c923b79e3d6d0817941bd3d7ca91576483397 (diff) | |
Disable-able animated GIFs in a non-shitty way (unlike wizardchan)
Diffstat (limited to 'js/inline-expanding.js')
| -rw-r--r-- | js/inline-expanding.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/js/inline-expanding.js b/js/inline-expanding.js index 04d9298f..5bbfa0a0 100644 --- a/js/inline-expanding.js +++ b/js/inline-expanding.js @@ -27,9 +27,17 @@ onready(function(){ if (!this.dataset.src) { this.parentNode.removeAttribute('style'); this.dataset.expanded = 'true'; + + if (this.childNodes[0].tagName === 'CANVAS') { + this.removeChild(this.childNodes[0]); + this.childNodes[0].style.display = 'block'; + } + this.dataset.src= this.childNodes[0].src; this.dataset.width = this.childNodes[0].style.width; this.dataset.height = this.childNodes[0].style.height; + + this.childNodes[0].src = this.href; this.childNodes[0].style.width = 'auto'; this.childNodes[0].style.height = 'auto'; @@ -48,6 +56,10 @@ onready(function(){ delete this.dataset.src; delete this.childNodes[0].style.opacity; delete this.childNodes[0].style.filter; + + if (localStorage.no_animated_gif === 'true' && typeof unanimate_gif === 'function') { + unanimate_gif(this.childNodes[0]); + } } return false; } |
