-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
2.6
-
MOODLE_26_STABLE
I've just noticed that the new actionmenu:
#) is not a course module
#) does not register to course base.
It seems that in order to make it work on new activities (either through drag/drop, or some other means), we call M.core.actionmenu.newDOMNode(newcm); (or something similar).
We already have a invocation wrapper to do this for us so that any third-party developers writing some code who want to apply all of the course JS to their code when they set up a new activity via JS can do so - I'm thinking of things like mod_subpage for example.
This is present in coursebase.
In order to use it, we need to create a new course-specific actionmenu which extends moodle-core-actionmenu, defines any of the relevant functions, and calls the corresponding moodle-core-actionmenu function.
In this case, we need it to define a function called register_new_module.
Admittedly this is underdocumented - it's not been moved to Shifter yet, and so we haven't added any API docs. Also, it should ideally be converted to a custom event which bubbles globally so that any module can hook into it, and any module can call the event, but for the moment we should use the existing infrastructure.
- duplicates
-
MDL-42117 Drag and drop upload of resources breaks AJAX actions
-
- Closed
-