3 namespace Drupal\Core\Ajax;
6 * Defines an AJAX command that closes the current active dialog.
10 class CloseDialogCommand implements CommandInterface {
13 * A CSS selector string of the dialog to close.
20 * Whether to persist the dialog in the DOM or not.
27 * Constructs a CloseDialogCommand object.
29 * @param string $selector
30 * A CSS selector string of the dialog to close.
31 * @param bool $persist
32 * (optional) Whether to persist the dialog in the DOM or not.
34 public function __construct($selector = NULL, $persist = FALSE) {
35 $this->selector = $selector ? $selector : '#drupal-modal';
36 $this->persist = $persist;
42 public function render() {
44 'command' => 'closeDialog',
45 'selector' => $this->selector,
46 'persist' => $this->persist,