Add an option to inlineEditor to prevent the height-matching behavior.
Review Request #4498 — Created Aug. 28, 2013 and submitted
Add an option to inlineEditor to prevent the height-matching behavior. In cases where we're rendering rich text formats like markdown, it's often that the height of the raw text won't match the height of the rendered element. Rather than try to do this matching and have it make the editor (often significantly) too big, always autosize it to fit the source text. By default, this will animate to the target size, which makes it seem just as smooth as before. It's only if people have disabled animation that it will seem jumpy.
Tested opening and closing the editor for various blocks of text. In particular, I tested the empty case (animate to minimum size) and the case where I had a big block of markdown text that rendered significantly larger than the text (due to images). In all cases, the text box was sized appropriately for the contents within, and the transitions were smooth.
-
This is a review from Review Bot. Tool: Pyflakes Processed Files: Ignored Files: djblets/media/js/jquery.gravy.js
- Change Summary:
-
Fix the jumpy-ness.
- Description:
-
Add an option to inlineEditor to prevent the height-matching behavior.
In cases where we're rendering rich text formats like markdown, it's often that
the height of the raw text won't match the height of the rendered element. Rather than try to do this matching and have it make the editor (often ~ significantly) too big, just autosize it to fit the source text. ~ significantly) too big, always autosize it to fit the source text. + + By default, this will animate to the target size, which makes it seem just as
+ smooth as before. It's only if people have disabled animation that it will seem + jumpy. - Testing Done:
-
+ Tested opening and closing the editor for various blocks of text. In
+ particular, I tested the empty case (animate to minimum size) and the case + where I had a big block of markdown text that rendered significantly larger + than the text (due to images). In all cases, the text box was sized + appropriately for the contents within, and the transitions were smooth. - Diff:
-
Revision 2 (+58 -30)
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: Ignored Files: djblets/media/js/jquery.gravy.js