Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes issue with nested elements reordering when count >= 50 #16030

Open
wants to merge 1 commit into
base: 5.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/cp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/cp.js.map

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions src/web/assets/cp/src/js/BaseElementIndexView.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,10 @@ Craft.BaseElementIndexView = Garnish.Base.extend(
// Give sub-classes a chance to do post-initialization stuff here
this.afterInit();

// Set up lazy-loading
// Set up $scroller for reordering
if (
!this.elementIndex.paginated &&
(!this.elementIndex.paginated ||
this.elementIndex.settings.context === 'embedded-index') &&
this.elementIndex.settings.batchSize
) {
if (this.settings.context === 'index') {
Expand All @@ -135,8 +136,12 @@ Craft.BaseElementIndexView = Garnish.Base.extend(
}

this.$scroller.scrollTop(0);
this.addListener(this.$scroller, 'scroll', 'maybeLoadMore');
this.maybeLoadMore();

// and if we're not in a paginated view, set up lazy-loading
if (!this.elementIndex.paginated) {
this.addListener(this.$scroller, 'scroll', 'maybeLoadMore');
this.maybeLoadMore();
}
}
},

Expand Down
5 changes: 4 additions & 1 deletion src/web/assets/cp/src/js/ElementTableSorter.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,10 @@ Craft.ElementTableSorter = Garnish.DragSort.extend(
this._setTargetLevelBounds();

// Check to see if we should load more elements now
this.tableView.maybeLoadMore();

if (!this.tableView.elementIndex.paginated) {
this.tableView.maybeLoadMore();
}

this.base();
},
Expand Down
Loading