diff --git a/client/res/templates/list-with-categories.tpl b/client/res/templates/list-with-categories.tpl
index cee91fa956..d55f9482ac 100644
--- a/client/res/templates/list-with-categories.tpl
+++ b/client/res/templates/list-with-categories.tpl
@@ -5,13 +5,6 @@
{{#unless categoriesDisabled}}
{{{categories}}}
-
- {{#if hasExpandedToggler}}
-
- {{/if}}
{{/unless}}
diff --git a/client/res/templates/record/list-tree.tpl b/client/res/templates/record/list-tree.tpl
index 52838275e4..2d3d047f63 100644
--- a/client/res/templates/record/list-tree.tpl
+++ b/client/res/templates/record/list-tree.tpl
@@ -20,7 +20,12 @@
{{rootName}}
{{/if}}
{{#if showEditLink}}
-
+
+ {{/if}}
+
+ {{#if hasExpandedToggler}}
+
+
{{/if}}
diff --git a/client/src/views/list-with-categories.js b/client/src/views/list-with-categories.js
index a2d163b6dd..063930a3fa 100644
--- a/client/src/views/list-with-categories.js
+++ b/client/src/views/list-with-categories.js
@@ -150,6 +150,9 @@ Espo.define('views/list-with-categories', 'views/list', function (Dep) {
this.applyCategoryToCollection();
this.clearView('nestedCategories');
+ if (this.hasView('categories')) {
+ this.getView('categories').isExpanded = true;
+ }
this.getRouter().navigate('#' + this.scope);
this.updateLastUrl();
@@ -166,6 +169,10 @@ Espo.define('views/list-with-categories', 'views/list', function (Dep) {
this.applyCategoryToCollection();
this.applyCategoryToNestedCategoriesCollection();
+ if (this.hasView('categories')) {
+ this.getView('categories').isExpanded = false;
+ }
+
this.navigateToCurrentCategory();
this.reRender();
@@ -304,7 +311,8 @@ Espo.define('views/list-with-categories', 'views/list', function (Dep) {
buttonsDisabled: true,
checkboxes: false,
showEditLink: this.getAcl().check(this.categoryScope, 'edit'),
- isExpanded: this.isExpanded
+ isExpanded: this.isExpanded,
+ hasExpandedToggler: this.hasExpandedToggler
}, function (view) {
if (this.currentCategoryId) {
view.setSelected(this.currentCategoryId);
diff --git a/client/src/views/record/list-tree.js b/client/src/views/record/list-tree.js
index 3fa99ae6fe..d21590c416 100644
--- a/client/src/views/record/list-tree.js
+++ b/client/src/views/record/list-tree.js
@@ -76,6 +76,11 @@ Espo.define('views/record/list-tree', 'views/record/list', function (Dep) {
data.rootIsSelected = true;
}
+ if (this.level == 0 && this.options.hasExpandedToggler) {
+ data.hasExpandedToggler = true;
+ data.isExpanded = this.isExpanded;
+ }
+
return data;
},
@@ -86,6 +91,8 @@ Espo.define('views/record/list-tree', 'views/record/list', function (Dep) {
this.createDisabled = this.options.createDisabled || this.createDisabled;
+ this.isExpanded = this.options.isExpanded;
+
if ('showRoot' in this.options) {
this.showRoot = this.options.showRoot;
if ('rootName' in this.options) {
diff --git a/frontend/less/espo/custom.less b/frontend/less/espo/custom.less
index 9dac71b7b8..8875a5e0ba 100644
--- a/frontend/less/espo/custom.less
+++ b/frontend/less/espo/custom.less
@@ -1458,8 +1458,13 @@ pre > code {
}
}
-.expanded-toggler-container {
- margin-top: 5px;
+.categories-container {
+ a.manage-categories-link {
+ margin-left: 8px;
+ }
+ a.category-expanded-toggle-link {
+ margin-left: 8px;
+ }
}
@media screen and (min-width: @screen-sm-min) {