fix issue with empty cat
This commit is contained in:
parent
d30603c7d1
commit
c6a43f755d
|
@ -15,7 +15,7 @@ You can report a bug or request a feature by opening an issue.
|
||||||
]]></description>
|
]]></description>
|
||||||
<licence>agpl</licence>
|
<licence>agpl</licence>
|
||||||
<author mail="contact@deblan.fr" homepage="https://www.deblan.io/">Simon Vieille</author>
|
<author mail="contact@deblan.fr" homepage="https://www.deblan.io/">Simon Vieille</author>
|
||||||
<version>1.8.0-rc1</version>
|
<version>1.8.0-rc2</version>
|
||||||
<namespace>SideMenu</namespace>
|
<namespace>SideMenu</namespace>
|
||||||
<category>customization</category>
|
<category>customization</category>
|
||||||
<website>https://gitnet.fr/deblan/side_menu</website>
|
<website>https://gitnet.fr/deblan/side_menu</website>
|
||||||
|
|
|
@ -188,7 +188,11 @@ class NavController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($items as $category => $value) {
|
foreach ($items as $category => $value) {
|
||||||
ksort($items[$category]['apps']);
|
if (empty($items[$category]['apps'])) {
|
||||||
|
unset($items[$category]);
|
||||||
|
} else {
|
||||||
|
ksort($items[$category]['apps']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
usort($items, function ($a, $b) {
|
usort($items, function ($a, $b) {
|
||||||
|
|
|
@ -61,13 +61,13 @@ export default {
|
||||||
.then(function(response) {
|
.then(function(response) {
|
||||||
that.items = response.data.items
|
that.items = response.data.items
|
||||||
|
|
||||||
let apps = []
|
let apps = []
|
||||||
|
|
||||||
for (let category of that.items) {
|
for (let category of that.items) {
|
||||||
for (let app of category.apps) {
|
for (let app of category.apps) {
|
||||||
apps.push(app)
|
apps.push(app)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
jQuery('body').trigger('side-menu.apps', [apps])
|
jQuery('body').trigger('side-menu.apps', [apps])
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue