X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Fmodules%2Fsettings_tray%2Fsrc%2FAjax%2FOpenOffCanvasDialogCommand.php;fp=web%2Fcore%2Fmodules%2Fsettings_tray%2Fsrc%2FAjax%2FOpenOffCanvasDialogCommand.php;h=c49c42e02bf8d4af59bea8664c3d1a23186e3dd6;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hp=0000000000000000000000000000000000000000;hpb=aea91e65e895364e460983b890e295aa5d5540a5;p=yaffs-website diff --git a/web/core/modules/settings_tray/src/Ajax/OpenOffCanvasDialogCommand.php b/web/core/modules/settings_tray/src/Ajax/OpenOffCanvasDialogCommand.php new file mode 100644 index 000000000..c49c42e02 --- /dev/null +++ b/web/core/modules/settings_tray/src/Ajax/OpenOffCanvasDialogCommand.php @@ -0,0 +1,73 @@ +dialogOptions['modal'] = FALSE; + $this->dialogOptions['autoResize'] = FALSE; + $this->dialogOptions['resizable'] = 'w'; + $this->dialogOptions['draggable'] = FALSE; + $this->dialogOptions['drupalAutoButtons'] = FALSE; + // @todo drupal.ajax.js does not respect drupalAutoButtons properly, pass an + // empty set of buttons until https://www.drupal.org/node/2793343 is in. + $this->dialogOptions['buttons'] = []; + if (empty($dialog_options['dialogClass'])) { + $this->dialogOptions['dialogClass'] = 'ui-dialog-off-canvas'; + } + // If no width option is provided then use the default width to avoid the + // dialog staying at the width of the previous instance when opened + // more than once, with different widths, on a single page. + if (!isset($this->dialogOptions['width'])) { + $this->dialogOptions['width'] = static::DEFAULT_DIALOG_WIDTH; + } + } + + /** + * {@inheritdoc} + */ + public function render() { + $build = parent::render(); + $build['effect'] = 'fade'; + $build['speed'] = 1000; + return $build; + } + +}