Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Won't Do
-
2.7.2
-
None
-
MOODLE_27_STABLE
Description
$PAGE->requires gives us a nice mechanism for initialising the JavaScript required when outputting a whole page.
But, in the case when we are re-loading part of a page through an Ajax request, there is no equivalent mechanism.
In the AJAX_SCRIPT $PAGE->requires will collect all the necssary JS, but then it is thrown away.
I guess we need a way to put that information into the JSON response, and then have a helper in M.util (or somewhere) to receive that response, and run the JS.
I found this while working on MDL-43089. Look at load_done in mod/quiz/yui/src/quizquestionbank/js/quizquestionbank.js. That is having to manually call all the necessary init methods, but that is very fragile. What if one of the other parts of Moodle changes its JS?
Attachments
Issue Links
- Discovered while testing
-
MDL-43089 Improved user interface for building quizzes
-
- Closed
-