diff --git a/src/Menu.php b/src/Menu.php index 191e1d1a17..120c237150 100644 --- a/src/Menu.php +++ b/src/Menu.php @@ -4,6 +4,8 @@ namespace Atk4\Ui; +use Atk4\Data\Model; + /** * Place menu. */ @@ -55,14 +57,8 @@ public function addItem($item = null, $action = null) if (is_string($action)) { $item->setAttr('href', $action); - } - - if ($action instanceof JsExpressionable) { - $item->js('click', $action); - } - - if ($action instanceof UserAction\ExecutorInterface) { - $item->on('click', $action); + } else { + $item->on('click', null, $action); } return $item;