Fix Gallery not rescrolling

This commit is contained in:
Zixaphir 2013-08-20 09:16:57 -07:00
parent 41ebd42722
commit c13b3731b7
3 changed files with 10 additions and 9 deletions

View File

@ -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]);

View File

@ -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]);

View File

@ -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: ->