This is a general collection of useful changes I've made. Some could be split into their own patches if desired.
The jQuery UI dialog API support a bunch of useful options that are difficult to apply.
This patch exposes the dialog options in a few places.
It also uses those options to stop the dialog from resizing when it goes from a currently open state, to a loading state. This is desirable when you have paged content inside a dialog and don't want it to constantly keep resizing.
It also adds a class to the dialog container when it has buttons.
Also, the patch exposes a new 'hook' of sorts that allow forms created with dialog_get_form() to still have custom options applied. The use case is when you create a menu router item that uses dialog_get_form() as the page callback. Any module can implement [form_id]_dialog_options() and return an array of options to be applied. I'm up for discussing this, perhaps a general dialog_options_alter, or just hook_dialog_options would be more generic and multiple modules could affect the same form easier.
Finally, support for $form_state['redirect'] is added to dialog_get_form().
| Comment | File | Size | Author |
|---|---|---|---|
| better_dialog_options.patch | 5.14 KB | te-brian |
Comments
Comment #1
drewish commentedHey, I'm trying to go through the queue and apply what works. It would be great if you could split this up into separate issues. It's hard to tell exactly what goes with what.
Comment #2
te-brian commentedNo problem. I'll see what I can do in the morning.
Comment #3
devin carlson commentedDialog 6.x is no longer supported.