jqh 5 years ago
parent
commit
c4537d2fce
4 changed files with 17 additions and 4 deletions
  1. 2 2
      resources/views/dashboard/title.blade.php
  2. 1 1
      src/Admin.php
  3. 1 1
      src/Grid/Tools.php
  4. 13 0
      src/Grid/Tools/RefreshButton.php

+ 2 - 2
resources/views/dashboard/title.blade.php

@@ -32,8 +32,8 @@
                 <h1 class="mb-3 mt-2 text-primary-darker">Dcat Admin</h1>
                 <div class="links">
                     <a href="https://github.com/jqhph/dcat-admin" target="_blank">Github</a>
-                    <a href="https://jqhph.github.io/dcat-admin/docs.html" id="doc-link" target="_blank">{{ __('admin.documentation') }}</a>
-                    <a href="https://jqhph.github.io/dcat-admin/docs/master/extensions.html" id="demo-link" target="_blank">{{ __('admin.extensions') }}</a>
+                    <a href="http://www.dcatadmin.com/" id="doc-link" target="_blank">{{ __('admin.documentation') }}</a>
+                    <a href="http://www.dcatadmin.com/" id="demo-link" target="_blank">{{ __('admin.extensions') }}</a>
                     <a href="https://jqhph.github.io/dcat-admin/demo.html" id="demo-link" target="_blank">{{ __('admin.demo') }}</a>
                 </div>
             </div>

+ 1 - 1
src/Admin.php

@@ -35,7 +35,7 @@ class Admin
      *
      * @var string
      */
-    const VERSION = '0.9.0';
+    const VERSION = '1.0.0';
 
     /**
      * @var array

+ 1 - 1
src/Grid/Tools.php

@@ -130,7 +130,7 @@ class Tools implements Renderable
     {
         $this->tools = $this->tools->map(function ($tool) use ($disable) {
             if ($tool instanceof RefreshButton) {
-                return $tool->disable($disable);
+                return $tool->display(! $disable);
             }
 
             return $tool;

+ 13 - 0
src/Grid/Tools/RefreshButton.php

@@ -6,6 +6,15 @@ use Illuminate\Contracts\Support\Renderable;
 
 class RefreshButton implements Renderable
 {
+    protected $display = true;
+
+    public function display($value)
+    {
+        $this->display = $value;
+
+        return $this;
+    }
+
     /**
      * Render refresh button of grid.
      *
@@ -13,6 +22,10 @@ class RefreshButton implements Renderable
      */
     public function render()
     {
+        if (! $this->display) {
+            return;
+        }
+
         $refresh = trans('admin.refresh');
 
         return <<<EOT