discourse/discourse — pull request #767 by ZogStriP (2013-04-25 01:35:08+00:00)
Title: improve & refactor quote reply

Improving & refactoring the `quote reply` pop-up a bit according to @SamSaffron's suggestion [on meta](http://meta.discourse.org/p/14218/1995).

I ended up removing all selection related code from the `post` controller and putting it into both `quote reply` controller and view.

The only issue I had from refactoring this code was that I had to find out which post was currently being selected. To find it out I extracted the `post-id` data from the nearest `.boxed` element and used it to find the matching post in the `controllers.topic.posts` collection.

I also fixed **2** bugs I discovered while testing:
- totally weird behaviour when searching for something using browser's native search
- the selection was not cleared when clicking on the arrow below the first post to toggle topic details.