Spin-off from #1870764: Add an ajax command which makes it easy to use the dialog API in complex cases. That issue is trying to accomplish several things related to better integrating Drupal's AJAX system, form wizards, and dialogs. This is a small spin-off of that targeted at just enabling options to be passed from AJAX to Drupal.dialog(). This is needed to unblock #1821548: Add a "diff" of some kind to the CMI UI which needs to be able to specify a larger than default width for its dialogs, so classifying as a major task.

This patch allows everything in #ajax['dialog'] to get passed as options to the jQuery $element.dialog() function. For example, '#ajax' => array('dialog' => array('modal' =>TRUE, 'width' => '750px')), would open a modal dialog 750px wide. Prior to this patch, 'modal' was the only option forwarded.

A concern with this is whether it binds Drupal's dialog implementation to jQuery UI. If Drupal code starts using arbitrary options defined by jQuery UI, but no other spec, then swapping the dialog implementation to some other library becomes harder.

#1 drupal-dialog-settings.patch1.42 KBeffulgentsia
PASSED: [[SimpleTest]]: [MySQL] 49,099 pass(es). View
Members fund testing for the Drupal project. Drupal Association Learn more


effulgentsia’s picture

1.42 KB
PASSED: [[SimpleTest]]: [MySQL] 49,099 pass(es). View
gdd’s picture

Is swapping out another implementation a large concern? I actually really like this approach, it is exactly the kind of thing I expected when the topic first came up in #1821548: Add a "diff" of some kind to the CMI UI.

nod_’s picture

Same here, looks great.

effulgentsia’s picture

Status: Needs review » Reviewed & tested by the community

nod_ is one of our JavaScript maintainers and has been one of the people most concerned with avoiding unnecessary jQuery UI dependency, so if he's ok with this, it's RTBC.

nod_’s picture

I can explain a bit to help make things clear.

1) The HTML5 dialog spec/draft has no "options" parameter because it relies on the DOM and CSS for styling. jQuery UI doesn't so it needs options for it's configuration. It's not an issue for core to rely on it since ultimately, it'll be implemented in browsers and we'll just ignore settings and let browser handle it.

2) jQuery has a nice API, the problem is if the options changes in jQuery UI but i'm not too concerned about that.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Hooray! Great to see this moving forward.

Committed and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jibran’s picture

Issue tags: +modal dialog