From 2a2fdaac3319bf24c4ca298f29184d98e28262d8 Mon Sep 17 00:00:00 2001 From: joe-allen-89 <85872286+joe-allen-89@users.noreply.github.com> Date: Thu, 19 Oct 2023 11:59:15 +0100 Subject: [PATCH] Fix: BoxMenuGroupView updated to exclude hidden children. --- js/BoxMenuGroupView.js | 4 +++- js/BoxMenuView.js | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/js/BoxMenuGroupView.js b/js/BoxMenuGroupView.js index 2230d29..5bd6937 100644 --- a/js/BoxMenuGroupView.js +++ b/js/BoxMenuGroupView.js @@ -15,7 +15,9 @@ class BoxMenuGroupView extends MenuItemView { } updateItemCount() { - const models = this.model.getChildren().models; + const models = this.model.getChildren().where({ + _isHidden: false + }); const totalChildren = models.length; models.forEach(model => model.set('_totalChild', totalChildren)); } diff --git a/js/BoxMenuView.js b/js/BoxMenuView.js index 25a2f7d..e98e7e5 100644 --- a/js/BoxMenuView.js +++ b/js/BoxMenuView.js @@ -24,7 +24,6 @@ class BoxMenuView extends MenuView { let nthChild = 0; const models = this.model.getChildren().models; const totalChild = this.model.getChildren().where({ - _isAvailable: true, _isHidden: false }).length;