Skip to content

Commit

Permalink
MDL-81725 core_courseformat: Prevent drag and drop handling subsections
Browse files Browse the repository at this point in the history
* Subsection are "modules" and should not be handled as "sections" in the
drag and drop process. Preventing delegated section from being dragged in
the dndsectionitems module fixes the drag and drop issues with subsections
in course index.
  • Loading branch information
laurentdavid committed Jul 2, 2024
1 parent cdc3ec5 commit 89b7511
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions course/format/amd/src/local/courseeditor/dndsectionitem.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ export default class extends BaseComponent {
* @returns {Object} exported course module drop data
*/
_getDraggableData() {
if (this.section.component !== null) {
return null;
}
const exporter = this.reactive.getExporter();
return exporter.sectionDraggableData(this.reactive.state, this.id);
}
Expand Down

0 comments on commit 89b7511

Please sign in to comment.