Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / lib / Drupal / Core / Render / MainContent / OffCanvasRenderer.php
index 55bf8eb7d1aef1ed582815fa915e63e0f11f904a..b8f0e73e5d98b7835af1e640983c2c9e612c877f 100644 (file)
@@ -23,6 +23,13 @@ class OffCanvasRenderer extends DialogRenderer {
    */
   protected $renderer;
 
+  /**
+   * The position to render the off-canvas dialog.
+   *
+   * @var string
+   */
+  protected $position;
+
   /**
    * Constructs a new OffCanvasRenderer.
    *
@@ -30,10 +37,13 @@ class OffCanvasRenderer extends DialogRenderer {
    *   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;
   }
 
   /**
@@ -55,7 +65,7 @@ class OffCanvasRenderer extends DialogRenderer {
     // 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;
   }