From c13b3731b7fc5cd24172bad2653f13c14cea9a1c Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Tue, 20 Aug 2013 09:16:57 -0700 Subject: [PATCH] Fix Gallery not rescrolling --- builds/appchan-x.user.js | 6 +++--- builds/crx/script.js | 6 +++--- src/Images/Gallery.coffee | 7 ++++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index f17e7f3ec..7ebb2b7e5 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -8868,7 +8868,8 @@ $.add(d.body, dialog); Gallery.thumbs.scrollTop = 0; Gallery.current.parentElement.scrollTop = 0; - return Gallery.cb.open.call(this !== Gallery ? $("[href=" + this.href + "]", Gallery.thumbs) : Gallery.images[0]); + Gallery.cb.open.call(this !== Gallery ? $("[href=" + this.href + "]", Gallery.thumbs) : Gallery.images[0]); + return d.body.style.overflow = 'hidden'; }, generateThumb: function(file) { var double, thumb, title; @@ -8915,8 +8916,7 @@ Gallery.current.dataset.id = this.dataset.id; Gallery.url.href = Gallery.current.src = this.href; Gallery.url.download = Gallery.current.title = this.title; - Gallery.current.parentElement.scrollTop = 0; - return d.body.style.overflow = 'hidden'; + return Gallery.url.parentElement.scrollTop = 0; }, prev: function() { return Gallery.cb.open.call(Gallery.images[+Gallery.current.dataset.id - 1]); diff --git a/builds/crx/script.js b/builds/crx/script.js index af47ac474..cf2c4ae6a 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -8856,7 +8856,8 @@ $.add(d.body, dialog); Gallery.thumbs.scrollTop = 0; Gallery.current.parentElement.scrollTop = 0; - return Gallery.cb.open.call(this !== Gallery ? $("[href=" + this.href + "]", Gallery.thumbs) : Gallery.images[0]); + Gallery.cb.open.call(this !== Gallery ? $("[href=" + this.href + "]", Gallery.thumbs) : Gallery.images[0]); + return d.body.style.overflow = 'hidden'; }, generateThumb: function(file) { var double, thumb, title; @@ -8903,8 +8904,7 @@ Gallery.current.dataset.id = this.dataset.id; Gallery.url.href = Gallery.current.src = this.href; Gallery.url.download = Gallery.current.title = this.title; - Gallery.current.parentElement.scrollTop = 0; - return d.body.style.overflow = 'hidden'; + return Gallery.url.parentElement.scrollTop = 0; }, prev: function() { return Gallery.cb.open.call(Gallery.images[+Gallery.current.dataset.id - 1]); diff --git a/src/Images/Gallery.coffee b/src/Images/Gallery.coffee index dcd33ad34..5c900b426 100644 --- a/src/Images/Gallery.coffee +++ b/src/Images/Gallery.coffee @@ -64,6 +64,8 @@ Gallery = else Gallery.images[0] + d.body.style.overflow = 'hidden' + generateThumb: (file) -> title = ($ '.fileText a', file).textContent thumb = ($ '.fileThumb', file).cloneNode true @@ -98,10 +100,9 @@ Gallery = if e e.preventDefault() Gallery.current.dataset.id = @dataset.id - Gallery.url.href = Gallery.current.src = @href + Gallery.url.href = Gallery.current.src = @href Gallery.url.download = Gallery.current.title = @title - Gallery.current.parentElement.scrollTop = 0 - d.body.style.overflow = 'hidden' + Gallery.url.parentElement.scrollTop = 0 prev: -> Gallery.cb.open.call Gallery.images[+Gallery.current.dataset.id - 1] next: ->