diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index d61684fb3..d09ecfd7d 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -8910,12 +8910,18 @@ } }, open: function(e) { + var img; + if (e) { e.preventDefault(); } - Gallery.current.dataset.id = this.dataset.id; - Gallery.url.href = Gallery.current.src = this.href; - Gallery.url.download = Gallery.current.title = this.title; + img = $.el('img', { + src: Gallery.url.href = this.href, + title: Gallery.url.download = this.title + }); + img.dataset.id = this.dataset.id; + $.replace(Gallery.current, img); + Gallery.current = img; return Gallery.url.parentElement.scrollTop = 0; }, prev: function() { diff --git a/builds/crx/script.js b/builds/crx/script.js index 68f587f09..d036abc91 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -8898,12 +8898,18 @@ } }, open: function(e) { + var img; + if (e) { e.preventDefault(); } - Gallery.current.dataset.id = this.dataset.id; - Gallery.url.href = Gallery.current.src = this.href; - Gallery.url.download = Gallery.current.title = this.title; + img = $.el('img', { + src: Gallery.url.href = this.href, + title: Gallery.url.download = this.title + }); + img.dataset.id = this.dataset.id; + $.replace(Gallery.current, img); + Gallery.current = img; return Gallery.url.parentElement.scrollTop = 0; }, prev: function() { diff --git a/src/Images/Gallery.coffee b/src/Images/Gallery.coffee index 5c900b426..0d0f28206 100644 --- a/src/Images/Gallery.coffee +++ b/src/Images/Gallery.coffee @@ -99,9 +99,14 @@ Gallery = open: (e) -> if e e.preventDefault() - Gallery.current.dataset.id = @dataset.id - Gallery.url.href = Gallery.current.src = @href - Gallery.url.download = Gallery.current.title = @title + + img = $.el 'img', + src: Gallery.url.href = @href + title: Gallery.url.download = @title + + img.dataset.id = @dataset.id + $.replace Gallery.current, img + Gallery.current = img Gallery.url.parentElement.scrollTop = 0 prev: -> Gallery.cb.open.call Gallery.images[+Gallery.current.dataset.id - 1]