Make draft RegionCommentBlock movable and resizable
Review Request #6974 — Created Feb. 23, 2015 and submitted
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 updatedEdge 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.
- Groups:
- Change Summary:
-
fixed getValidMaxSize function to calculate max-height correctly.
- Commit:
-
3e89a0eb9a3fc6e663ccae384bd40726f6e4074421f6bfd47e1820edd5af52a0db7ddd2af59606e5
- Diff:
-
Revision 2 (+377 -23)
-
Tool: Pyflakes Processed Files: reviewboard/staticbundles.py Ignored Files: reviewboard/static/rb/js/views/abstractCommentBlockView.js reviewboard/static/rb/js/utils/mathUtils.js reviewboard/static/rb/js/resources/models/tests/baseResourceModelTests.js reviewboard/static/rb/css/pages/image-review-ui.less reviewboard/static/rb/js/models/regionCommentBlockModel.js reviewboard/static/rb/js/views/regionCommentBlockView.js reviewboard/static/rb/js/views/imageReviewableView.js reviewboard/static/rb/js/resources/models/baseResourceModel.js Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py Ignored Files: reviewboard/static/rb/js/views/abstractCommentBlockView.js reviewboard/static/rb/js/utils/mathUtils.js reviewboard/static/rb/js/resources/models/tests/baseResourceModelTests.js reviewboard/static/rb/css/pages/image-review-ui.less reviewboard/static/rb/js/models/regionCommentBlockModel.js reviewboard/static/rb/js/views/regionCommentBlockView.js reviewboard/static/rb/js/views/imageReviewableView.js reviewboard/static/rb/js/resources/models/baseResourceModel.js