Просмотр исходного кода

Grid\Column::modal()增加xl方法

jqh 5 лет назад
Родитель
Сommit
b4c2f301be
1 измененных файлов с 10 добавлено и 1 удалено
  1. 10 1
      src/Grid/Displayers/Modal.php

+ 10 - 1
src/Grid/Displayers/Modal.php

@@ -10,11 +10,18 @@ class Modal extends AbstractDisplayer
 {
     protected $title;
 
+    protected $xl = false;
+
     public function title(string $title)
     {
         $this->title = $title;
     }
 
+    public function xl()
+    {
+        $this->xl = true;
+    }
+
     protected function setUpLazyRenderable(LazyRenderable $renderable)
     {
         return clone $renderable->payload(['key' => $this->getKey()]);
@@ -48,7 +55,9 @@ class Modal extends AbstractDisplayer
         $title = $this->title ?: $title;
 
         return WidgetModal::make()
-            ->lg()
+            ->when(true, function ($modal) {
+                $this->xl ? $modal->xl() : $modal->lg();
+            })
             ->title($title)
             ->body($html)
             ->delay(300)