MDL-68778 user: Add bulk action pendingjs checks

This commit is contained in:
Andrew Nicols 2020-05-20 08:47:02 +08:00
parent db5be3a31c
commit fb4f19af80
3 changed files with 7 additions and 2 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -30,6 +30,7 @@ import CustomEvents from 'core/custom_interaction_events';
import DynamicTableSelectors from 'core_table/local/dynamic/selectors';
import ModalEvents from 'core/modal_events';
import Notification from 'core/notification';
import Pending from 'core/pending';
import jQuery from 'jquery';
import {showAddNote, showSendMessage} from 'core_user/local/participants/bulkactions';
@ -63,6 +64,7 @@ export const init = ({
const action = bulkActionSelect.value;
const tableRoot = getTableFromUniqueId(uniqueid);
const checkboxes = tableRoot.querySelectorAll(Selectors.bulkUserSelectedCheckBoxes);
const pendingPromise = new Pending('core_user/participants:bulkActionSelect');
if (action.indexOf('#') !== -1) {
e.preventDefault();
@ -85,6 +87,7 @@ export const init = ({
}
if (bulkAction) {
const pendingBulkAction = new Pending('core_user/participants:bulkActionSelected');
bulkAction
.then(modal => {
modal.getRoot().on(ModalEvents.hidden, () => {
@ -92,6 +95,7 @@ export const init = ({
bulkActionSelect.focus();
});
pendingBulkAction.resolve();
return modal;
})
.catch(Notification.exception);
@ -101,6 +105,7 @@ export const init = ({
}
resetBulkAction(bulkActionSelect);
pendingPromise.resolve();
});
root.addEventListener('click', e => {