From dd0ef505e774bcfcee5684d963c35da483fb80d5 Mon Sep 17 00:00:00 2001 From: Hao Sun Date: Tue, 11 Apr 2023 10:16:18 +0800 Subject: [PATCH] * zin: auto load dtable on click featurebar --- zin/wg/featurebar/v1.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/zin/wg/featurebar/v1.php b/zin/wg/featurebar/v1.php index 1bf3ea400d..cf5966add3 100644 --- a/zin/wg/featurebar/v1.php +++ b/zin/wg/featurebar/v1.php @@ -34,6 +34,8 @@ class featureBar extends wg $link = $this->prop('link'); $currentStory = $this->prop('currentStory', data('storyBrowseType', '')); + useData('activeFeature', $current); + if(empty($link)) { $linkParams = $this->prop('linkParams'); @@ -60,7 +62,8 @@ class featureBar extends wg ( 'text' => $text, 'active' => $key == $currentStory, - 'url' => ($callback instanceof \Closure) ? $callback($key, $text) : createLink($app->rawModule, $app->rawMethod) + 'url' => ($callback instanceof \Closure) ? $callback($key, $text) : createLink($app->rawModule, $app->rawMethod), + 'props' => ['data-id' => $key, 'data-load' => 'table'] ); } @@ -71,7 +74,8 @@ class featureBar extends wg 'url' => str_replace('{key}', $item->name, $link), 'badge' => $isActive && !empty($recTotal) ? array('text' => $recTotal, 'class' => 'size-sm circle white') : NULL, 'type' => 'dropdown', - 'items' => $subItems + 'items' => $subItems, + 'props' => ['data-id' => $item->name, 'data-load' => 'table'] ); continue; @@ -84,6 +88,7 @@ class featureBar extends wg 'active' => $isActive, 'url' => str_replace('{key}', $item->name, $link), 'badge' => $isActive && !empty($recTotal) ? array('text' => $recTotal, 'class' => 'size-sm circle white') : NULL, + 'props' => ['data-id' => $item->name, 'data-load' => 'table'] ); }