FYI changes to require_js

FYI changes to require_js

by Tim Hunt -
Number of replies: 0
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
There is a strange situation with require_js from ajaxlib. Originally it was implemented for the ajax features, but then it evolved into a general (and very useful and easy-to-use) system for including any JavaScript, and so the
 if (!ajaxenabled()) {
 //return false;
 }
code in there was commented out.

However I just noticed that in print_header, there was another check like that which meant that:
  • If you call require_js before print_header, your js isn't included.
  • If you call it afterwards, your js is included.
I am pretty sure that is a bug, so I just commented out the
if (!ajaxenabled())
Check in print_header. I hope that is OK with everyone. If anyone wants to revert this, you will break the quiz, and probably other places too.
Average of ratings: -