jqh 4 years ago
parent
commit
89021ccaf0
4 changed files with 8 additions and 29 deletions
  1. 0 12
      src/Actions/Action.php
  2. 1 1
      src/Grid/Concerns/HasActions.php
  3. 7 1
      src/Tree.php
  4. 0 15
      src/Tree/Actions.php

+ 0 - 12
src/Actions/Action.php

@@ -154,18 +154,6 @@ abstract class Action implements Renderable
         return '.act-'.Str::random();
     }
 
-    /**
-     * @param string $prefix
-     * @param string $class
-     *
-     * @return string
-     */
-    public function getSelectorKey($prefix, $class)
-    {
-        return $prefix.'-'.($class ?: static::class)
-            .md5($this->normalizeConfirmData().$this->normalizeParameters());
-    }
-
     /**
      * @param string|array $class
      *

+ 1 - 1
src/Grid/Concerns/HasActions.php

@@ -70,7 +70,7 @@ trait HasActions
                 }
 
                 foreach ($action as $v) {
-                    $actions->append($v);
+                    $actions->append(clone $v);
                 }
             };
         }

+ 7 - 1
src/Tree.php

@@ -455,7 +455,13 @@ class Tree implements Renderable
             $this->actionCallbacks[] = $callback;
         } else {
             $this->actionCallbacks[] = function (Actions $actions) use ($callback) {
-                $actions->append($callback);
+                if (! is_array($callback)) {
+                    $callback = [$callback];
+                }
+
+                foreach ($callback as $value) {
+                    $actions->append(clone $value);
+                }
             };
         }
 

+ 0 - 15
src/Tree/Actions.php

@@ -53,13 +53,6 @@ class Actions implements Renderable
      */
     public function append($action)
     {
-        if (is_array($action)) {
-            foreach ($action as $value) {
-                $this->append($value);
-            }
-
-            return $this;
-        }
         $this->prepareAction($action);
 
         array_push($this->appends, $action);
@@ -74,14 +67,6 @@ class Actions implements Renderable
      */
     public function prepend($action)
     {
-        if (is_array($action)) {
-            foreach ($action as $value) {
-                $this->prepend($value);
-            }
-
-            return $this;
-        }
-
         $this->prepareAction($action);
 
         array_unshift($this->prepends, $action);