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); $.add(d.body, dialog);
Gallery.thumbs.scrollTop = 0; Gallery.thumbs.scrollTop = 0;
Gallery.current.parentElement.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) { generateThumb: function(file) {
var double, thumb, title; var double, thumb, title;
@ -8915,8 +8916,7 @@
Gallery.current.dataset.id = this.dataset.id; Gallery.current.dataset.id = this.dataset.id;
Gallery.url.href = Gallery.current.src = this.href; Gallery.url.href = Gallery.current.src = this.href;
Gallery.url.download = Gallery.current.title = this.title; Gallery.url.download = Gallery.current.title = this.title;
Gallery.current.parentElement.scrollTop = 0; return Gallery.url.parentElement.scrollTop = 0;
return d.body.style.overflow = 'hidden';
}, },
prev: function() { prev: function() {
return Gallery.cb.open.call(Gallery.images[+Gallery.current.dataset.id - 1]); return Gallery.cb.open.call(Gallery.images[+Gallery.current.dataset.id - 1]);

View File

@ -8856,7 +8856,8 @@
$.add(d.body, dialog); $.add(d.body, dialog);
Gallery.thumbs.scrollTop = 0; Gallery.thumbs.scrollTop = 0;
Gallery.current.parentElement.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) { generateThumb: function(file) {
var double, thumb, title; var double, thumb, title;
@ -8903,8 +8904,7 @@
Gallery.current.dataset.id = this.dataset.id; Gallery.current.dataset.id = this.dataset.id;
Gallery.url.href = Gallery.current.src = this.href; Gallery.url.href = Gallery.current.src = this.href;
Gallery.url.download = Gallery.current.title = this.title; Gallery.url.download = Gallery.current.title = this.title;
Gallery.current.parentElement.scrollTop = 0; return Gallery.url.parentElement.scrollTop = 0;
return d.body.style.overflow = 'hidden';
}, },
prev: function() { prev: function() {
return Gallery.cb.open.call(Gallery.images[+Gallery.current.dataset.id - 1]); return Gallery.cb.open.call(Gallery.images[+Gallery.current.dataset.id - 1]);

View File

@ -64,6 +64,8 @@ Gallery =
else else
Gallery.images[0] Gallery.images[0]
d.body.style.overflow = 'hidden'
generateThumb: (file) -> generateThumb: (file) ->
title = ($ '.fileText a', file).textContent title = ($ '.fileText a', file).textContent
thumb = ($ '.fileThumb', file).cloneNode true thumb = ($ '.fileThumb', file).cloneNode true
@ -100,8 +102,7 @@ Gallery =
Gallery.current.dataset.id = @dataset.id 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.url.download = Gallery.current.title = @title
Gallery.current.parentElement.scrollTop = 0 Gallery.url.parentElement.scrollTop = 0
d.body.style.overflow = 'hidden'
prev: -> prev: ->
Gallery.cb.open.call Gallery.images[+Gallery.current.dataset.id - 1] Gallery.cb.open.call Gallery.images[+Gallery.current.dataset.id - 1]
next: -> next: ->