Improve performances when expanding all images and they were already loaded.
This commit is contained in:
parent
d4a0af9e21
commit
53ab332406
@ -3272,12 +3272,13 @@ ImageExpand =
|
|||||||
return unless $.hasClass thumb, 'expanding' # contracted before the image loaded
|
return unless $.hasClass thumb, 'expanding' # contracted before the image loaded
|
||||||
prev = post.nodes.root.getBoundingClientRect()
|
prev = post.nodes.root.getBoundingClientRect()
|
||||||
post.file.isExpanded = true
|
post.file.isExpanded = true
|
||||||
$.addClass post.nodes.root, 'expanded-image'
|
$.queueTask ->
|
||||||
$.rmClass post.file.thumb, 'expanding'
|
$.addClass post.nodes.root, 'expanded-image'
|
||||||
return unless prev.top + prev.height <= 0
|
$.rmClass post.file.thumb, 'expanding'
|
||||||
root = if $.engine is 'webkit' then d.body else doc
|
return unless prev.top + prev.height <= 0
|
||||||
curr = post.nodes.root.getBoundingClientRect()
|
root = if $.engine is 'webkit' then d.body else doc
|
||||||
root.scrollTop += curr.height - prev.height + curr.top - prev.top
|
curr = post.nodes.root.getBoundingClientRect()
|
||||||
|
root.scrollTop += curr.height - prev.height + curr.top - prev.top
|
||||||
|
|
||||||
error: ->
|
error: ->
|
||||||
post = Get.postFromNode @
|
post = Get.postFromNode @
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user