MDL-57417 navigation: fix legacy_activity_onclick_handler callback scope

This commit is contained in:
Jake Dallimore
2016-12-23 08:43:37 +08:00
parent a09a9879e5
commit 96e743ff78
+1 -1
View File
@@ -2104,7 +2104,7 @@ class global_navigation extends navigation_node {
$onclick = htmlspecialchars_decode($activity->onclick, ENT_QUOTES);
// Build the JS function the click event will call
$jscode = "function {$functionname}(e) { $propogrationhandler $onclick }";
$this->page->requires->js_init_code($jscode);
$this->page->requires->js_amd_inline($jscode);
// Override the default url with the new action link
$action = new action_link($action, $activityname, new component_action('click', $functionname));
}