mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch 'MDL-69241-master' of git://github.com/mickhawkins/moodle
This commit is contained in:
commit
dec6eebdaa
2
lib/table/amd/build/dynamic.min.js
vendored
2
lib/table/amd/build/dynamic.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -156,14 +156,6 @@ export const updateTable = (tableRoot, {
|
||||
tableRoot.dataset.tableLastInitial = lastInitial;
|
||||
}
|
||||
|
||||
if (pageNumber !== null) {
|
||||
if (tableRoot.dataset.tablePageNumber != pageNumber) {
|
||||
tableConfigChanged = true;
|
||||
}
|
||||
|
||||
tableRoot.dataset.tablePageNumber = pageNumber;
|
||||
}
|
||||
|
||||
if (pageSize !== null) {
|
||||
if (tableRoot.dataset.tablePageSize != pageSize) {
|
||||
tableConfigChanged = true;
|
||||
@ -183,6 +175,12 @@ export const updateTable = (tableRoot, {
|
||||
tableRoot.dataset.tableFilters = filterJson;
|
||||
}
|
||||
|
||||
// Reset to page 1 when table content is being altered by filtering or sorting.
|
||||
// This ensures the table page being loaded always exists, and gives a consistent experience.
|
||||
if (tableConfigChanged) {
|
||||
pageNumber = 1;
|
||||
}
|
||||
|
||||
// Update hidden columns.
|
||||
if (hiddenColumns) {
|
||||
const columnJson = JSON.stringify(hiddenColumns);
|
||||
@ -194,6 +192,14 @@ export const updateTable = (tableRoot, {
|
||||
tableRoot.dataset.tableHiddenColumns = columnJson;
|
||||
}
|
||||
|
||||
if (pageNumber !== null) {
|
||||
if (tableRoot.dataset.tablePageNumber != pageNumber) {
|
||||
tableConfigChanged = true;
|
||||
}
|
||||
|
||||
tableRoot.dataset.tablePageNumber = pageNumber;
|
||||
}
|
||||
|
||||
// Refresh.
|
||||
if (refreshContent && tableConfigChanged) {
|
||||
return refreshTableContent(tableRoot)
|
||||
|
Loading…
x
Reference in New Issue
Block a user