MDL-68256 task admin UI: Grrrr! browsers

This commit is contained in:
Tim Hunt
2020-04-07 19:04:53 +02:00
committed by Sara Arjona
parent b3f562176c
commit 9205d263d6
+3 -1
View File
@@ -182,8 +182,10 @@ class tool_task_renderer extends plugin_renderer_base {
}
$table->data = $data;
if ($lastchanged) {
// IE does not support this, and the ancient version of Firefox we use for Behat
// has the method, but then errors on 'centre'. So, just try to scroll, and if it fails, don't care.
$this->page->requires->js_init_code(
'document.querySelector("tr.table-primary").scrollIntoView({block: "center"});');
'try{document.querySelector("tr.table-primary").scrollIntoView({block: "center"});}catch(e){}');
}
return html_writer::table($table);
}