fix category tree

This commit is contained in:
Yuri Kuznetsov
2021-07-01 13:11:17 +03:00
parent 7df4084d45
commit 9667c2fc5a
2 changed files with 12 additions and 21 deletions
@@ -8,7 +8,7 @@
</div>
{{/if}}
<div class="{{#if hasTree}} col-md-9 col-sm-8{{else}} col-md-12{{/if}} list-main-column">
<div class="nested-categories-container{{#if hasTree}} hidden{{/if}}">{{{nestedCategories}}}</div>
<div class="nested-categories-container{{#unless hasNestedCategories}} hidden{{/unless}}">{{{nestedCategories}}}</div>
<div class="list-container">{{{list}}}</div>
</div>
</div>
+11 -20
View File
@@ -63,6 +63,8 @@ define('views/list-with-categories', 'views/list', function (Dep) {
data.hasTree = (this.isExpanded || this.hasNavigationPanel) && !this.categoriesDisabled;
data.hasNestedCategories = !this.isExpanded;
return data;
},
@@ -214,7 +216,7 @@ define('views/list-with-categories', 'views/list', function (Dep) {
}
if (!this.isExpanded && !this.hasView('nestedCategories')) {
this.loadNestedCategories();
this.loadNestedCategories();
}
},
@@ -226,11 +228,6 @@ define('views/list-with-categories', 'views/list', function (Dep) {
this.applyCategoryToCollection();
this.clearView('nestedCategories');
/*if (this.hasView('categories')) {
this.getView('categories').isExpanded = true;
}*/
this.clearView('categories');
this.getRouter().navigate('#' + this.scope);
@@ -250,9 +247,6 @@ define('views/list-with-categories', 'views/list', function (Dep) {
this.applyCategoryToCollection();
this.applyCategoryToNestedCategoriesCollection();
/*if (this.hasView('categories')) {
this.getView('categories').isExpanded = false;
}*/
this.clearView('categories');
this.navigateToCurrentCategory();
@@ -325,25 +319,22 @@ define('views/list-with-categories', 'views/list', function (Dep) {
Promise.all([
this.nestedCategoriesCollection
.fetch()
.then(
function () {
this.controlNestedCategoriesVisibility();
this.updateHeader();
}.bind(this)
),
.then(() => {
this.controlNestedCategoriesVisibility();
this.updateHeader();
}),
this.collection.fetch({openCategory: true})
]).then(function () {
]).then(() => {
Espo.Ui.notify(false);
this.controlListVisibility();
}.bind(this));
});
}
else {
this.collection.fetch().then(function () {
this.collection.fetch().then(() => {
Espo.Ui.notify(false);
}.bind(this));
});
}
},