Kaynağa Gözat

表格modal标题设置优化

jqh 5 yıl önce
ebeveyn
işleme
4994ad13c7
1 değiştirilmiş dosya ile 3 ekleme ve 2 silme
  1. 3 2
      src/Grid/Displayers/Modal.php

+ 3 - 2
src/Grid/Displayers/Modal.php

@@ -57,12 +57,11 @@ JS;
 
     public function display($callback = null)
     {
-        $title = $this->trans('title');
+        $title = $this->value ?: $this->trans('title');
         if (func_num_args() == 2) {
             [$title, $callback] = func_get_args();
         }
 
-        $title = $this->title ?: $title;
         $html = $this->value;
         $id = $this->generateElementId();
 
@@ -80,6 +79,8 @@ JS;
             $this->setUpRemoteRenderable($id, $callback);
         }
 
+        $title = $this->title ?: $title;
+
         return <<<EOT
 <span class="grid-expand" data-toggle="modal" data-target="#{$id}">
    <a href="javascript:void(0)"><i class="fa fa-clone"></i>&nbsp;&nbsp;{$this->value}</a>