Move diff expand/collapse support into the new DiffReviewableView.
Review Request #4257 — Created June 24, 2013 and submitted
Move diff expand/collapse support into the new DiffReviewableView. The resulting code is actually cleaner than the old code, because we have more context to work from, instead of having to embed a bunch of stuff inside the links. There's now unit tests that ensure our expand/collapse logic works correctly. It also fixes a regression in collapsing that was introduced in the original DiffReviewable model that was pulled out early on in the JavaScript refactoring. This is the last work needed before we can move the DiffComment support over.
Tested expanding in every possible way, and collapsing each expanded state. Unit tests pass.
Description | From | Last Updated |
---|---|---|
You need to define 'var i' above. |
david | |
So I recall when I was optimizing rbpdf that jquery's scrollTop and height methods were much, much slower than the … |
david | |
Same here re: profiling with .offset() and .height() |
david | |
Can you move the && to the next line to avoid the visual confusion between the conditional and the block? |
david | |
I don't see where this is ever assigned. |
david |
- Change Summary:
-
Added a missing variable declaration.
- Diff:
-
Revision 2 (+661 -269)
-
-
So I recall when I was optimizing rbpdf that jquery's scrollTop and height methods were much, much slower than the DOM versions. Can you profile scrolling around and see what sort of impact these have?
-
-
Can you move the && to the next line to avoid the visual confusion between the conditional and the block?
-
- Change Summary:
-
* Cached $(window) in the view for MUCH faster performance when positioning the collapse button on scroll. * Removed some dead code for scrollAnchorSel. * Changed the formatting for an if statement.
- Diff:
-
Revision 3 (+661 -269)
- Change Summary:
-
* Improved some long-standing visual issues with the collapse button positioning on some browsers, which made it jump just a bit when going between fixed and absolute positioning. * Sped up the collapse button logic when there are no collapse buttons in a diff. * Sped up the fixed position codepath. It's now skipped entirely if it's already set to fixed. This also let us remove an outerHeight() call in this case. * Changed the collapse button padding to be set in pixels instead of ems, which fixed a visual issue I noticed with the border.
- Diff:
-
Revision 4 (+668 -270)