diff --git a/client/res/templates/record/list-nested-categories.tpl b/client/res/templates/record/list-nested-categories.tpl index 513a70edb2..7b0a13edc6 100644 --- a/client/res/templates/record/list-nested-categories.tpl +++ b/client/res/templates/record/list-nested-categories.tpl @@ -83,9 +83,5 @@ {{/if}} - -{{else}} -
-
{{/unless}} \ No newline at end of file diff --git a/client/src/views/list-with-categories.js b/client/src/views/list-with-categories.js index eb5fa241fc..719b584500 100644 --- a/client/src/views/list-with-categories.js +++ b/client/src/views/list-with-categories.js @@ -235,8 +235,12 @@ define('views/list-with-categories', 'views/list', function (Dep) { }, actionOpenCategory: function (data) { + this.hideListViewWhileNestedCategoriesLoaded(); + this.openCategory(data.id || null, data.name); + this.selectCurrentCategory(); + this.navigateToCurrentCategory(); }, @@ -625,5 +629,13 @@ define('views/list-with-categories', 'views/list', function (Dep) { updateHeader: function () { this.getView('header').reRender(); }, + + hideListViewWhileNestedCategoriesLoaded: function () { + this.$listContainer.addClass('hidden'); + + this.nestedCategoriesCollection.once('sync', function () { + this.$listContainer.removeClass('hidden'); + }, this); + }, }); });