Переглянути джерело

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

jqh 5 роки тому
батько
коміт
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 $title;
 
 
+    protected $xl = false;
+
     public function title(string $title)
     public function title(string $title)
     {
     {
         $this->title = $title;
         $this->title = $title;
     }
     }
 
 
+    public function xl()
+    {
+        $this->xl = true;
+    }
+
     protected function setUpLazyRenderable(LazyRenderable $renderable)
     protected function setUpLazyRenderable(LazyRenderable $renderable)
     {
     {
         return clone $renderable->payload(['key' => $this->getKey()]);
         return clone $renderable->payload(['key' => $this->getKey()]);
@@ -48,7 +55,9 @@ class Modal extends AbstractDisplayer
         $title = $this->title ?: $title;
         $title = $this->title ?: $title;
 
 
         return WidgetModal::make()
         return WidgetModal::make()
-            ->lg()
+            ->when(true, function ($modal) {
+                $this->xl ? $modal->xl() : $modal->lg();
+            })
             ->title($title)
             ->title($title)
             ->body($html)
             ->body($html)
             ->delay(300)
             ->delay(300)