Merge branch 'Faldrian-3307-collapse_long_images' into develop
This commit is contained in:
commit
d67ec12913
2 changed files with 16 additions and 0 deletions
|
|
@ -113,6 +113,7 @@ Contributions are very welcome, the hard work is done!
|
|||
* Posts of ignored users are now visible on that profile page [#6617](https://github.com/diaspora/diaspora/pull/6617)
|
||||
* Add white color theme [#6631](https://github.com/diaspora/diaspora/pull/6631)
|
||||
* Add answer counts to poll [#6641](https://github.com/diaspora/diaspora/pull/6641)
|
||||
* Check for collapsible posts after images in posts have loaded [#6671](https://github.com/diaspora/diaspora/pull/6671)
|
||||
|
||||
# 0.5.7.0
|
||||
|
||||
|
|
|
|||
|
|
@ -72,6 +72,21 @@ app.views.Content = app.views.Base.extend({
|
|||
|
||||
postRenderTemplate : function(){
|
||||
_.defer(_.bind(this.collapseOversized, this));
|
||||
|
||||
// run collapseOversized again after all contained images are loaded
|
||||
var self = this;
|
||||
_.defer(function() {
|
||||
self.$("img").each(function() {
|
||||
this.addEventListener("load", function() {
|
||||
// only fire if the top of the post is in viewport
|
||||
var rect = self.el.getBoundingClientRect();
|
||||
if(rect.top > 0) {
|
||||
self.collapseOversized.call(self);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
var photoAttachments = this.$(".photo_attachments");
|
||||
if(photoAttachments.length > 0) {
|
||||
new app.views.Gallery({ el: photoAttachments });
|
||||
|
|
|
|||
Loading…
Reference in a new issue