diaspora/diaspora — pull request #2941 by Raven24 (2012-02-27 15:58:35+00:00)
Title: bug mash #2

This is probably more of a suggestion than something that can be pulled into master without modifications. I hope you can use parts of it (or even all of it).

First of all, I re-did the "show more" stuff to work with the container height instead of word count, because the old js replaced the containers which lead to #2920 and #2731 (and maybe some more). The content is now displayed in a single container and the stuff that's too high gets cut off with `overflow: hidden` and can be expanded by a 'button' (see screenshot) which slides the container to its full height.
Since I am not the worlds greatest designer, you might want to change the look of that...

That meant I needed to handle posts with oembed-ed content differently, because youtube doesn't give their flash objects `wmode=transparent` so that other elements could be rendered on top of them. So I am showing the oembed thumbnail when the post is collapsed and the actual content when it is expanded.

This is where I would need help, though. The jasmine tests are all adapted to the new stuff, except "app.views.Stream - clicking read more - expands the post", which refuses to do what I want it to. The container gets classes "collapsed" or "opened", depending on the state, but I can't get jasmine to correctly test for it...

The other issue I addressed was that likes/follows cause the content to reload, which would cause a playing youtube video to reset. So I created a separate Backbone model for the feedback view and let all the change events for likes and follows render only inside the feedback view, leaving the content unmodified. That is actually working better than I expected, seeing as my experience with Backbone is non-existent.

Please give me some feedback, and I hope that this is something that can actually be used ;)

Here's a screenshot of collapsed posts:
![show more](http://img593.imageshack.us/img593/8348/showmore.png)