categories small fix
This commit is contained in:
@@ -5,13 +5,6 @@
|
||||
{{#unless categoriesDisabled}}
|
||||
<div class="{{#unless categoriesDisabled}} col-md-3 col-sm-4{{else}} col-md-12{{/unless}}">
|
||||
<div class="categories-container">{{{categories}}}</div>
|
||||
|
||||
{{#if hasExpandedToggler}}
|
||||
<div class="expanded-toggler-container">
|
||||
<a href="javascript:" title="{{translate 'Collapse'}}" class="action{{#unless isExpanded}} hidden{{/unless}}" data-action="collapse"><span class="small glyphicon glyphicon-folder-open"></span></a>
|
||||
<a href="javascript:" title="{{translate 'Expand'}}" class="action{{#if isExpanded}} hidden{{/if}}" data-action="expand""><span class="small glyphicon glyphicon-folder-close"></span></a>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/unless}}
|
||||
<div class="{{#unless categoriesDisabled}} col-md-9 col-sm-8{{else}} col-md-12{{/unless}}">
|
||||
|
||||
@@ -20,7 +20,12 @@
|
||||
<a href="#{{scope}}" class="action link{{#if rootIsSelected}} text-bold{{/if}}" data-action="selectRoot">{{rootName}}</a>
|
||||
{{/if}}
|
||||
{{#if showEditLink}}
|
||||
<a href="#{{scope}}" class="small pull-right action" data-action="manageCategories" title="{{translate 'Manage Categories' scope=scope}}"><span class="glyphicon glyphicon-th-list"></span></a>
|
||||
<a href="#{{scope}}" class="small pull-right action manage-categories-link" data-action="manageCategories" title="{{translate 'Manage Categories' scope=scope}}"><span class="glyphicon glyphicon-th-list"></span></a>
|
||||
{{/if}}
|
||||
|
||||
{{#if hasExpandedToggler}}
|
||||
<a href="javascript:" title="{{translate 'Collapse'}}" class="small pull-right category-expanded-toggle-link action{{#unless isExpanded}} hidden{{/unless}}" data-action="collapse"><span class="glyphicon glyphicon-folder-open"></span></a>
|
||||
<a href="javascript:" title="{{translate 'Expand'}}" class="small pull-right category-expanded-toggle-link action{{#if isExpanded}} hidden{{/if}}" data-action="expand""><span class="glyphicon glyphicon-folder-close"></span></a>
|
||||
{{/if}}
|
||||
|
||||
<ul class="list-group list-group-tree list-group-no-border">
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user