MDL-72915 qtype_ddimageortext: Fix eventHandler for Unlimited items

Sometimes, for the question that has a lot of input groups and unlimited draggable items,
the 'clone' process takes longer than usual, so the questionManager.init() method
will not add the eventHandler for the cloned drag.
We should make sure to bind the eventHandler for the cloned too
This commit is contained in:
Huong Nguyen 2022-02-09 15:23:31 +07:00
parent 5897242361
commit b5c181f117
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

@ -284,6 +284,11 @@ define(['jquery', 'core/dragdrop', 'core/key_codes'], function($, dragDrop, keys
cloneDrag.removeClass('beingdragged');
cloneDrag.removeAttr('tabindex');
hiddenDrag.after(cloneDrag);
// Sometimes, for the question that has a lot of input groups and unlimited draggable items,
// this 'clone' process takes longer than usual, so the questionManager.init() method
// will not add the eventHandler for this cloned drag.
// We need to make sure to add the eventHandler for the cloned drag too.
questionManager.addEventHandlersToDrag(cloneDrag);
} else {
hiddenDrag.addClass('active');
}