From ada7df25a7a4bb3dabeceee634b123a857748c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 7 Aug 2015 13:18:33 +0200 Subject: [PATCH] fix minor consistence bug --- js/stores/edition_list_store.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js/stores/edition_list_store.js b/js/stores/edition_list_store.js index f5430d6c..90f48e8f 100644 --- a/js/stores/edition_list_store.js +++ b/js/stores/edition_list_store.js @@ -133,9 +133,17 @@ class EditionListStore { } onToggleEditionList(pieceId) { + this.isEditionListOpenForPieceId[pieceId] = { show: this.isEditionListOpenForPieceId[pieceId] ? !this.isEditionListOpenForPieceId[pieceId].show : true }; + + if(!this.isEditionListOpenForPieceId[pieceId].show) { + // to clear an array, david walsh recommends to just set it's length to zero + // http://davidwalsh.name/empty-array + + this.editionList[pieceId].length = 0; + } } onCloseAllEditionLists() {