categories loading flicking fix

This commit is contained in:
Yuri Kuznetsov
2021-05-08 16:33:02 +03:00
parent 4d2c7bd776
commit d6092fc3eb
2 changed files with 12 additions and 4 deletions
@@ -83,9 +83,5 @@
</div>
{{/if}}
</div>
</div>
{{else}}
<div class="list-nested-categories" style="height: 100px;">
</div>
{{/unless}}
+12
View File
@@ -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);
},
});
});