mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 18:06:51 +02:00
Merge branch 'MDL-68951-master' of git://github.com/andrewnicols/moodle
This commit is contained in:
commit
5a862ca1a2
12 changed files with 32 additions and 21 deletions
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
|
@ -26,6 +26,7 @@ import Events from './local/dynamic/events';
|
|||
import Pending from 'core/pending';
|
||||
import {addIconToContainer} from 'core/loadingicon';
|
||||
import {fetch as fetchTableData} from 'core_table/local/dynamic/repository';
|
||||
import Notification from 'core/notification';
|
||||
|
||||
let watching = false;
|
||||
|
||||
|
@ -248,7 +249,7 @@ export const getPageNumber = tableRoot => getTableData(tableRoot).tablePageNumbe
|
|||
* @returns {Promise}
|
||||
*/
|
||||
export const setPageSize = (tableRoot, pageSize, refreshContent = true) =>
|
||||
updateTable(tableRoot, {pageSize, pageNumber: 0}, refreshContent);
|
||||
updateTable(tableRoot, {pageSize, pageNumber: 1}, refreshContent);
|
||||
|
||||
/**
|
||||
* Get the current page size.
|
||||
|
@ -353,49 +354,50 @@ export const init = () => {
|
|||
if (sortableLink) {
|
||||
e.preventDefault();
|
||||
|
||||
setSortOrder(tableRoot, sortableLink.dataset.sortby, sortableLink.dataset.sortorder);
|
||||
setSortOrder(tableRoot, sortableLink.dataset.sortby, sortableLink.dataset.sortorder)
|
||||
.catch(Notification.exception);
|
||||
}
|
||||
|
||||
const firstInitialLink = e.target.closest(Selectors.initialsBar.links.firstInitial);
|
||||
if (firstInitialLink !== null) {
|
||||
e.preventDefault();
|
||||
|
||||
setFirstInitial(tableRoot, firstInitialLink.dataset.initial);
|
||||
setFirstInitial(tableRoot, firstInitialLink.dataset.initial).catch(Notification.exception);
|
||||
}
|
||||
|
||||
const lastInitialLink = e.target.closest(Selectors.initialsBar.links.lastInitial);
|
||||
if (lastInitialLink !== null) {
|
||||
e.preventDefault();
|
||||
|
||||
setLastInitial(tableRoot, lastInitialLink.dataset.initial);
|
||||
setLastInitial(tableRoot, lastInitialLink.dataset.initial).catch(Notification.exception);
|
||||
}
|
||||
|
||||
const pageItem = e.target.closest(Selectors.paginationBar.links.pageItem);
|
||||
if (pageItem) {
|
||||
e.preventDefault();
|
||||
|
||||
setPageNumber(tableRoot, pageItem.dataset.pageNumber);
|
||||
setPageNumber(tableRoot, pageItem.dataset.pageNumber).catch(Notification.exception);
|
||||
}
|
||||
|
||||
const hide = e.target.closest(Selectors.table.links.hide);
|
||||
if (hide) {
|
||||
e.preventDefault();
|
||||
|
||||
hideColumn(tableRoot, hide.dataset.column);
|
||||
hideColumn(tableRoot, hide.dataset.column).catch(Notification.exception);
|
||||
}
|
||||
|
||||
const show = e.target.closest(Selectors.table.links.show);
|
||||
if (show) {
|
||||
e.preventDefault();
|
||||
|
||||
showColumn(tableRoot, show.dataset.column);
|
||||
showColumn(tableRoot, show.dataset.column).catch(Notification.exception);
|
||||
}
|
||||
|
||||
const resetTablePreferencesLink = e.target.closest('.resettable a');
|
||||
if (resetTablePreferencesLink) {
|
||||
e.preventDefault();
|
||||
|
||||
resetTablePreferences(tableRoot);
|
||||
resetTablePreferences(tableRoot).catch(Notification.exception);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue