Merge lp:~rharding/launchpad/bugfix_891735 into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Aaron Bentley |
Approved revision: | no longer in the source branch. |
Merged at revision: | 14379 |
Proposed branch: | lp:~rharding/launchpad/bugfix_891735 |
Merge into: | lp:launchpad |
Diff against target: |
470 lines (+422/-1) 5 files modified
lib/lp/app/javascript/formwidgets/resizing_textarea.js (+209/-0) lib/lp/app/javascript/formwidgets/tests/test_resizing_textarea.html (+32/-0) lib/lp/app/javascript/formwidgets/tests/test_resizing_textarea.js (+166/-0) lib/lp/bugs/javascript/filebug_dupefinder.js (+14/-1) lib/lp/bugs/javascript/tests/test_filebug_dupfinder.html (+1/-0) |
To merge this branch: | bzr merge lp:~rharding/launchpad/bugfix_891735 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Aaron Bentley (community) | Approve | ||
Review via email: mp+83217@code.launchpad.net |
This proposal supersedes a proposal from 2011-11-22.
Commit message
[r=abentley][bug=891735] create new YUI plugin for auto resizing textarea ui widgets to the formwidget library and add the new widget to the bug report comment textarea
Description of the change
= Summary =
Add a new auto resizing textarea widget for launchpad
== Proposed fix ==
Added a new module under the lp.app.formwidgets namespace called ResizingTextarea. This is a YUI plugin and can be stuck on any textarea YUI node instances.
== Pre-implementation notes ==
Attempted to use a YUI Gallery module that lacked features and performed poorly. Talked with Deryck and we agreed to work on our own module. Deryck pointed me towards the functionality in the inline edit module and to check if we could use that.
I took a peek at the inline editor module, and it does some of the same thing, but it's not modular enough to just use for simple textareas like the initial sample case of the new bug submitting form. It's also less missing some types of changes into the textarea and missing features such as the min and max height code.
Discussed with Deryck and abently and decided that this can proceed, with the understanding that the next goal will be refactoring the inline edit module to use this plugin as a means to manage its own auto resizing behavior. The inline edit will then only need to worry about button, save/cancel events, and such.
== Implementation details ==
The new plugin uses a YUI specific "valueChanged" event for detecting if the content of an input has changed by any means (pasting, key stroke, etc).
It removes the browsers feature for users to resize the textarea via the corner grab point since that can throw off the calculations of the size of the textarea.
It accepts parameters for min and max heights to help duplicate the functionality of defining rows in a textarea.
The adding and removing of rows of space are animated via a css3 transition. It should gracefull degrade on older browsers. There is a flag for turning off all animations. That's used to help keep tests from taking too long to run.
== Tests ==
./bin/test -cvvt test_resizing_
$browser lib/lp/
== Demo and Q/A ==
The tests are the main Q/A right now. The single point where it's created is when adding a new bug. So go to:
https:/
Enter a summary, the "Further information" textarea should be an instance of ResizingTextarea and as you enter new lines it will start to expand. There's a default 450px height so at that point, the scrollbar should show up and begin to lengthen.
I'm confused - the bug description editing field already autosizes
(poorly, but it does) - is that not widget already?