discourse/discourse — pull request #561 by ZogStriP (2013-03-25 01:25:50+00:00)
Title: FIX: "Quote Reply" button gets in the way

Meta: ["Quote Reply" gets in the way](http://meta.discourse.org/t/quote-reply-gets-in-the-way/1495)

This PR modifies the way the "Quote Reply" button is displayed.

It will now be displayed **near** the cursor when the user release the mouse's button.

There are **2** selection cases:

### Forward selection
![Screenshot_25_03_13_02_15](https://f.cloud.github.com/assets/362783/296239/9f6404f4-94e9-11e2-854a-83fbae4cdff4.png)

The user starts its selection at `uccessfully` and ends at `accounts`.
The "Quote Reply" button is displayed **centered & right under** the mouse.

### Backward selection
![Screenshot_25_03_13_02_16](https://f.cloud.github.com/assets/362783/296240/cac89b64-94e9-11e2-8a34-d11a54914e41.png)

The user starts its selection at `play` and ends at `successfully`.
The "Quote Reply" button is displayed **centered & right above** the mouse.

This has been tested on Mac OS X (10.8.3) with
- [x] Chrome **25.0.1364.172**
- [x] Firefox **19.0.2**
- [x] Safari **6.0.3**

The code is based on @timdown's response to: [How can I position an element next to user text selection?](http://stackoverflow.com/questions/1589721/how-can-i-position-an-element-next-to-user-text-selection/1589912#1589912)