Scroll oversized images in the image review UI
Review Request #8377 — Created Sept. 2, 2016 and submitted
Previously, oversized images in the image review UI would cause them to
overflow outside of the review box and increase the width of the page.
Now, these images are confined to the width of the review box and will
scroll horizontally when they are too large.
- Created a review comment on an oversized image; it scrolled with the
page. - Scrolled an oversized image and created a commment; it worked
correctly and scrolled with the page. - Ensured the scroll bar only showed when images were oversized for the
currently selected scale.
Description | From | Last Updated |
---|---|---|
Can you test scrolling and then adding a comment? |
david | |
Should be in alphabetical order within the other classes. |
chipx86 | |
Since you're adding a new one, can you add docs to the doc comment? ("Model Attributes" section.) |
chipx86 | |
Two blank lines. |
chipx86 | |
Should be able to cleanly fit all these like: this.listenTo(this.model, 'change:scale', ...) |
chipx86 | |
Should be one statement, like before, since we're not chaining. |
chipx86 | |
This can be one statement. |
chipx86 | |
I really want to avoid using these. I know it's not the most popular opinion, but it ends up resulting … |
chipx86 | |
I also want to avoid using for of. This feels like a slim little useful statement, but balloons into a … |
chipx86 | |
Same as above. The spacing on either side of the text inside the <li> will be preserved, and we should … |
chipx86 | |
No need for the blank line here. |
chipx86 | |
This is left over. |
chipx86 | |
Trailing newline. |
chipx86 | |
We're doing a lot of mixing of local variable declarations and other code. Mind cleaning this up while here by … |
chipx86 | |
Might as well add a trailing comma here too. |
chipx86 | |
Let's add a trailing comma here, too, while we're at it. |
chipx86 |
-
I'd really like to see testing of commenting while scrolled and the display of the comment block outlines at various zoom/scroll combinations.
- Summary:
-
Create a wrapper to scroll oversized images in the image review UIScroll oversized images in the image review UI
- Description:
-
~ Previously, the image review UI would overflow horizontally and increase
~ the width of the page. Now, the review UI is limited to the file ~ attachment box and it will scroll horiztonally within it. ~ Previously, oversized images in the image review UI would cause them to
~ overflow outside of the review box and increase the width of the page. ~ Now, these images are confined to the width of the review box and will + scroll horizontally when they are too large. + + Additionally, image scaling has been moved into the
RB.ImageReviewable
+ (which has been converted to ES6 to allow for trailing commas) so that + we can listen in the different image views for when the scale changes, + as well as programmatically trigger scale changes without resorting to + invoking a click handler. - Testing Done:
-
~ Tested the review UI with an oversized image. It scrolled.
~ - Created a review comment on an oversized image; it scrolled with the
page.
+ - Ensured the scroll bar only showed when images were oversized for the
currently selected scale.
- Created a review comment on an oversized image; it scrolled with the
-
Tool: Pyflakes Processed Files: reviewboard/staticbundles.py Ignored Files: reviewboard/static/rb/css/pages/image-review-ui.less reviewboard/static/rb/js/views/regionCommentBlockView.es6.js reviewboard/static/rb/js/views/imageReviewableView.es6.js reviewboard/static/rb/js/models/imageReviewableModel.es6.js Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py Ignored Files: reviewboard/static/rb/css/pages/image-review-ui.less reviewboard/static/rb/js/views/regionCommentBlockView.es6.js reviewboard/static/rb/js/views/imageReviewableView.es6.js reviewboard/static/rb/js/models/imageReviewableModel.es6.js
-
-
-
-
-
-
-
-
I really want to avoid using these. I know it's not the most popular opinion, but it ends up resulting in much larger strings, as we have no real control over where spaces and newlines live. All leading indentation ends up as part of the string. This cannot be minified out, resulting in larger JavaScript, and it's more content for the template parser to parse.
Same below.
-
I also want to avoid using
for of
. This feels like a slim little useful statement, but balloons into a whole lot of very slow code that cannot be easily optimized out.This becomes:
var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = scalingFactors[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var _step$value = _slicedToArray(_step.value, 2); var scale = _step$value[0]; var text = _step$value[1]; $menu.append(...) } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } }
-
Same as above. The spacing on either side of the text inside the
<li>
will be preserved, and we should avoid that.We should also be treating the text as unsafe HTML, in case we need to localize any of it down the road. (I could see options like "Fit to window".) Building as a jQuery is going to be safer here.
-
-
- Change Summary:
-
Addressed Christian's issues.
- Diff:
-
Revision 3 (+137 -103)
-
Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py Ignored Files: reviewboard/static/rb/css/pages/image-review-ui.less reviewboard/static/rb/js/models/imageReviewableModel.js reviewboard/static/rb/js/views/imageReviewableView.es6.js reviewboard/static/rb/js/models/imageReviewableModel.es6.js reviewboard/static/rb/js/views/regionCommentBlockView.es6.js Tool: Pyflakes Processed Files: reviewboard/staticbundles.py Ignored Files: reviewboard/static/rb/css/pages/image-review-ui.less reviewboard/static/rb/js/models/imageReviewableModel.js reviewboard/static/rb/js/views/imageReviewableView.es6.js reviewboard/static/rb/js/models/imageReviewableModel.es6.js reviewboard/static/rb/js/views/regionCommentBlockView.es6.js
- Change Summary:
-
Address Christian's issues
- Diff:
-
Revision 4 (+137 -104)
-
Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py Ignored Files: reviewboard/static/rb/css/pages/image-review-ui.less reviewboard/static/rb/js/models/imageReviewableModel.js reviewboard/static/rb/js/views/imageReviewableView.es6.js reviewboard/static/rb/js/models/imageReviewableModel.es6.js reviewboard/static/rb/js/views/regionCommentBlockView.es6.js Tool: Pyflakes Processed Files: reviewboard/staticbundles.py Ignored Files: reviewboard/static/rb/css/pages/image-review-ui.less reviewboard/static/rb/js/models/imageReviewableModel.js reviewboard/static/rb/js/views/imageReviewableView.es6.js reviewboard/static/rb/js/models/imageReviewableModel.es6.js reviewboard/static/rb/js/views/regionCommentBlockView.es6.js
- Description:
-
Previously, oversized images in the image review UI would cause them to
overflow outside of the review box and increase the width of the page. Now, these images are confined to the width of the review box and will scroll horizontally when they are too large. - - Additionally, image scaling has been moved into the
RB.ImageReviewable
- (which has been converted to ES6 to allow for trailing commas) so that - we can listen in the different image views for when the scale changes, - as well as programmatically trigger scale changes without resorting to - invoking a click handler. - Testing Done:
-
- Created a review comment on an oversized image; it scrolled with the
page.
~ - Ensured the scroll bar only showed when images were oversized for the
currently selected scale.
~ - Scrolled an oversized image and created a commment; it worked
correctly and scrolled with the page.
+ - Ensured the scroll bar only showed when images were oversized for the
currently selected scale.
- Created a review comment on an oversized image; it scrolled with the