mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
list show more fix nested case
This commit is contained in:
@@ -61,13 +61,17 @@
|
||||
|
||||
{{#if showMoreEnabled}}
|
||||
{{#if showMoreActive}}
|
||||
<div class="show-more{{#unless showMoreActive}} hidden{{/unless}}">
|
||||
<div
|
||||
class="show-more {{#unless showMoreActive}} hidden {{/unless}}"
|
||||
data-owner-cid="{{viewObject.cid}}"
|
||||
>
|
||||
<a
|
||||
type="button"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
class="btn btn-default btn-block"
|
||||
data-action="showMore"
|
||||
data-owner-cid="{{viewObject.cid}}"
|
||||
{{#if showCount}}title="{{translate 'Total'}}: {{totalCountFormatted}}"{{/if}}
|
||||
>
|
||||
{{#if showCount}}
|
||||
|
||||
@@ -106,16 +106,20 @@
|
||||
|
||||
{{#if showMoreIsActive}}
|
||||
<div class="category-cell">
|
||||
<div class="category-item show-more">
|
||||
<span class="category-item-name">
|
||||
<a
|
||||
role="button"
|
||||
tabindex="0"
|
||||
class="action"
|
||||
data-action="showMore"
|
||||
title="{{translate 'Show more'}}"
|
||||
>...</a>
|
||||
</span>
|
||||
<div
|
||||
class="category-item show-more"
|
||||
data-owner-cid="{{viewObject.cid}}"
|
||||
>
|
||||
<span class="category-item-name">
|
||||
<a
|
||||
role="button"
|
||||
tabindex="0"
|
||||
class="action"
|
||||
data-action="showMore"
|
||||
data-owner-cid="{{viewObject.cid}}"
|
||||
title="{{translate 'Show more'}}"
|
||||
>...</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
@@ -228,13 +228,17 @@
|
||||
</table>
|
||||
|
||||
{{#if showMoreEnabled}}
|
||||
<div class="show-more{{#unless showMoreActive}} hidden{{/unless}}">
|
||||
<div
|
||||
class="show-more {{#unless showMoreActive}} hidden {{/unless}}"
|
||||
data-owner-cid="{{viewObject.cid}}"
|
||||
>
|
||||
<a
|
||||
type="button"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
class="btn btn-default btn-block"
|
||||
data-action="showMore"
|
||||
data-owner-cid="{{viewObject.cid}}"
|
||||
{{#if showCount}}title="{{translate 'Total'}}: {{totalCountFormatted}}"{{/if}}
|
||||
>
|
||||
{{#if showCount}}
|
||||
|
||||
@@ -657,12 +657,6 @@ class ListRecordView extends View {
|
||||
|
||||
this.actionQuickView({id: id});
|
||||
},
|
||||
/** @this ListRecordView */
|
||||
'click [data-action="showMore"]': async function () {
|
||||
this.showMoreRecords();
|
||||
|
||||
this.focusOnList();
|
||||
},
|
||||
'mousedown a.sort': function (e) {
|
||||
e.preventDefault();
|
||||
},
|
||||
@@ -2026,6 +2020,15 @@ class ListRecordView extends View {
|
||||
this.processLinkClick(target.dataset.id);
|
||||
});
|
||||
|
||||
this.addHandler('click', '[data-action="showMore"]', (e, target) => {
|
||||
if (target.dataset.ownerCid && target.dataset.ownerCid !== this.cid) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.showMoreRecords();
|
||||
this.focusOnList();
|
||||
})
|
||||
|
||||
if (typeof this.collection === 'undefined') {
|
||||
throw new Error('Collection has not been injected into views/record/list view.');
|
||||
}
|
||||
@@ -3254,7 +3257,7 @@ class ListRecordView extends View {
|
||||
*/
|
||||
showMoreRecords(options, collection, $list, $showMore, callback) {
|
||||
collection = collection || this.collection;
|
||||
$showMore = $showMore || this.$el.find('.show-more');
|
||||
$showMore = $showMore || this.$el.find(`.show-more[data-owner-cid="${this.cid}"]`);
|
||||
$list = $list || this.$el.find(this.listContainerEl);
|
||||
options = options || {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user