* [bug #60091] fix api item show duplicated in sidebar of doc app.
This commit is contained in:
@@ -340,6 +340,7 @@ class api extends control
|
||||
$api->originTitle = $api->title;
|
||||
$api->icon = "api is-$api->method";
|
||||
$api->title = "$api->method $api->path $api->title";
|
||||
$api->api = true;
|
||||
}
|
||||
$this->send($api);
|
||||
}
|
||||
|
||||
@@ -169,6 +169,6 @@ div
|
||||
'const docApp = zui.DocApp.query("#api-content");',
|
||||
'if(!docApp) return;',
|
||||
'const apiData = ' . json_encode($apiData) . ';',
|
||||
'docApp.$.update("doc", apiData);'
|
||||
'docApp.$.update("doc", docApp.$.formatDataItem("doc", apiData));'
|
||||
)
|
||||
);
|
||||
|
||||
@@ -105,5 +105,13 @@ docApp
|
||||
set::pager(array('recTotal' => $recTotal, 'recPerPage' => $recPerPage, 'page' => $pageID)),
|
||||
set::privs($privs),
|
||||
set::showLibFiles($privs['showFiles'] ? array('product', 'project', 'execution') : false),
|
||||
set::formatDataItem
|
||||
(
|
||||
jsCallback('type', 'item')
|
||||
->beginIf('type === "doc"', 'item.api', 'typeof item.id === "number"')
|
||||
->do('item.id = `api.${item.id}`')
|
||||
->endIf()
|
||||
->do('return item')
|
||||
),
|
||||
set('$options', jsRaw('window.setDocAppOptions'))
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user