Make draft RegionCommentBlock movable and resizable

Review Request #6974 — Created Feb. 23, 2015 and submitted — Latest diff uploaded

Information

Review Board
master
21f6bfd...

Reviewers

Make draft RegionCommentBlock movable and resizable.

Currently, a RegionCommentBlock is not movable or resizable, even if it is a draft. This change makes draft RegionCommentBlocks movable or resizable by drag-and-drop'ing left-top or right bottom corner of them. Users finish resizing by mouse-up action, and the draft RegionCommentBlock's new bound is saved on server. RegionCommentBlockView handles mouseup and mousedown, and simulate click event if mouseup happened w/o any drag. Click on RegionCommentBlockView shows the comment inside, and shows an editor to change it, if any comment in the block is a draft.

I made this RR to combine two RRs:
https://reviews.reviewboard.org/r/6886/
https://reviews.reviewboard.org/r/6919/
and fix click/drag-and-drop bugs in them.

Passed all tests in "/js-test/".

Browser test done:
1. Go to file attachment review page, for example, http://localhost:8080/r/7/file/4/
2. Make draft comment
3. Try moving
4. Try resizing
5. Refresh the page
6. See if the bounds updated

Edge cases tested:
1. Open file attachment review page, make resize/move "once" and refresh. => Fixed and working well.
2. Try click-and-drag non-draft commentBlocks. => Non-drafy commentBlcoks are not movable. Working as expected.

    Loading...