*/
protected $renderer;
+ /**
+ * The position to render the off-canvas dialog.
+ *
+ * @var string
+ */
+ protected $position;
+
/**
* Constructs a new OffCanvasRenderer.
*
* The title resolver.
* @param \Drupal\Core\Render\RendererInterface $renderer
* The renderer.
+ * @param string $position
+ * (optional) The position to render the off-canvas dialog.
*/
- public function __construct(TitleResolverInterface $title_resolver, RendererInterface $renderer) {
+ public function __construct(TitleResolverInterface $title_resolver, RendererInterface $renderer, $position = 'side') {
parent::__construct($title_resolver);
$this->renderer = $renderer;
+ $this->position = $position;
}
/**
// Determine the title: use the title provided by the main content if any,
// otherwise get it from the routing information.
$options = $request->request->get('dialogOptions', []);
- $response->addCommand(new OpenOffCanvasDialogCommand($title, $content, $options));
+ $response->addCommand(new OpenOffCanvasDialogCommand($title, $content, $options, NULL, $this->position));
return $response;
}