Skip to content

Commit

Permalink
drop special handling of array first item
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Dec 21, 2022
1 parent ca89e44 commit 3dac414
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -1017,16 +1017,7 @@ public function jsRender(): string
};

// Dealing with callback action.
if ($action instanceof \Closure || (is_array($action) && ($action[0] ?? null) instanceof \Closure)) {
if (is_array($action)) {
$urlData = $action;
unset($urlData[0]);
foreach ($urlData as $a) {
$actions[] = $a;
}
$action = $action[0];
}

if ($action instanceof \Closure) {
// create callback, that will include event as part of the full name
$cb = JsCallback::addTo($this, [], [['desired_name' => $event]]);
if ($defaults['apiConfig'] ?? null) {
Expand Down

0 comments on commit 3dac414

Please sign in to comment.