Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / system / tests / modules / off_canvas_test / src / Controller / TestController.php
index ea310fa0bdf8291132cc373924b88310d0cd78f5..fbfa5a7bdd187e0ac510bc8a7f5caa27418f61f4 100644 (file)
@@ -45,17 +45,22 @@ class TestController {
   public function linksDisplay() {
     return [
       'off_canvas_link_1' => [
-        '#title' => 'Click Me 1!',
+        '#title' => 'Open side panel 1',
         '#type' => 'link',
         '#url' => Url::fromRoute('off_canvas_test.thing1'),
         '#attributes' => [
           'class' => ['use-ajax'],
           'data-dialog-type' => 'dialog',
           'data-dialog-renderer' => 'off_canvas',
+          'data-dialog-options' => Json::encode([
+            'classes' => [
+              "ui-dialog" => "ui-corner-all side-1",
+            ],
+          ]),
         ],
       ],
       'off_canvas_link_2' => [
-        '#title' => 'Click Me 2!',
+        '#title' => 'Open side panel 2',
         '#type' => 'link',
         '#url' => Url::fromRoute('off_canvas_test.thing2'),
         '#attributes' => [
@@ -64,6 +69,43 @@ class TestController {
           'data-dialog-renderer' => 'off_canvas',
           'data-dialog-options' => Json::encode([
             'width' => 555,
+            'classes' => [
+              "ui-dialog" => "ui-corner-all side-2",
+            ],
+          ]),
+        ],
+      ],
+      'off_canvas_top_link_1' => [
+        '#title' => 'Open top panel 1',
+        '#type' => 'link',
+        '#url' => Url::fromRoute('off_canvas_test.thing1'),
+        '#attributes' => [
+          'class' => ['use-ajax'],
+          'data-dialog-type' => 'dialog',
+          'data-dialog-renderer' => 'off_canvas_top',
+          'data-dialog-options' => Json::encode([
+            'width' => 555,
+            'classes' => [
+              "ui-dialog" => "ui-corner-all top-1",
+            ],
+          ]),
+        ],
+
+      ],
+      'off_canvas_top_link_2' => [
+        '#title' => 'Open top panel 2',
+        '#type' => 'link',
+        '#url' => Url::fromRoute('off_canvas_test.thing2'),
+        '#attributes' => [
+          'class' => ['use-ajax'],
+          'data-dialog-type' => 'dialog',
+          'data-dialog-renderer' => 'off_canvas_top',
+          'data-dialog-options' => Json::encode([
+            'height' => 421,
+            'classes' => [
+              "ui-dialog" => "ui-corner-all top-2",
+            ],
+
           ]),
         ],
       ],