From d6092fc3ebba67d35c12dec00b960b52c86293d2 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Sat, 8 May 2021 16:33:02 +0300 Subject: [PATCH] categories loading flicking fix --- .../res/templates/record/list-nested-categories.tpl | 4 ---- client/src/views/list-with-categories.js | 12 ++++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) 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); + }, }); });