Merge lp:~rockstar/phazr/forms-and-overlays into lp:phazr
Status: | Merged |
---|---|
Approved by: | Paul Hummer |
Approved revision: | 10 |
Merged at revision: | 3 |
Proposed branch: | lp:~rockstar/phazr/forms-and-overlays |
Merge into: | lp:phazr |
Diff against target: |
231 lines (+196/-0) 5 files modified
examples/formplugin/index.html (+48/-0) src/css/phazr.css (+13/-0) src/js/formplugin/formplugin.js (+72/-0) tests/formplugin.js (+45/-0) tests/index.html (+18/-0) |
To merge this branch: | bzr merge lp:~rockstar/phazr/forms-and-overlays |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Deryck Hodge | code | Approve | |
Review via email: mp+54115@code.launchpad.net |
Commit message
Provide a FormPlugin for Overlay, so that we can handle forms in a cleaner manner.
Description of the change
This branch adds a plugin to Y.Overlay that makes it easy to work with forms in the overlay. It provides two methods that hang off the host overlay: loadForm and loadFormFromURL. They essentially do the same thing, one loads the form from a string, the other loads it from a URL.
Along with those two methods, it also replaces the footer with Save/Cancel buttons. It automatically deals with the Cancel event by hiding the form (smart). It defaults the Save button to an empty function. When plugging the plugin, it takes a submitFn property that is the save function.
It also has tests.
Nicely played, sir! Amazing to see some of the functionality we use now re-written to leverage YUI better. As we discussed, your instincts are good to not override the footer. Do a new node after it with the buttons.
I'll also go on record as being unsure of the docstring-like test names, though I do find it helpful all the same. I game to try it this way for phazr, but it's kind of odd all the same.