3 namespace Drupal\Core\Ajax;
6 * Defines an AJAX command that sets jQuery UI dialog properties.
10 class SetDialogOptionCommand implements CommandInterface {
13 * A CSS selector string.
20 * A jQuery UI dialog option name.
24 protected $optionName;
27 * A jQuery UI dialog option value.
31 protected $optionValue;
34 * Constructs a SetDialogOptionCommand object.
36 * @param string $selector
37 * The selector of the dialog whose title will be set. If set to an empty
38 * value, the default modal dialog will be selected.
39 * @param string $option_name
40 * The name of the option to set. May be any jQuery UI dialog option.
41 * See http://api.jqueryui.com/dialog.
42 * @param mixed $option_value
43 * The value of the option to be passed to the dialog.
45 public function __construct($selector, $option_name, $option_value) {
46 $this->selector = $selector ? $selector : '#drupal-modal';
47 $this->optionName = $option_name;
48 $this->optionValue = $option_value;
54 public function render() {
56 'command' => 'setDialogOption',
57 'selector' => $this->selector,
58 'optionName' => $this->optionName,
59 'optionValue' => $this->optionValue,