MDL-68189 course: Section name change should display in DD menu

This patch removed the sectionname hidden element (that was not used
by the keyboard menu anyway)

Changed the aria-label of the section to aria-labelled by as this
means that the description will change as drag and drop updated
things without the need to add additional JavaScript.
This commit is contained in:
Neill Magill 2020-03-24 08:25:04 +00:00
parent 1d4fdb0d1c
commit 2ad7a19565

View File

@ -202,10 +202,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
$o.= html_writer::start_tag('li', array('id' => 'section-'.$section->section,
'class' => 'section main clearfix'.$sectionstyle, 'role'=>'region',
'aria-label'=> get_section_name($course, $section)));
// Create a span that contains the section title to be used to create the keyboard section move menu.
$o .= html_writer::tag('span', get_section_name($course, $section), array('class' => 'hidden sectionname'));
'aria-labelledby' => "sectionid-{$section->id}-title"));
$leftcontent = $this->section_left_content($section, $course, $onsectionpage);
$o.= html_writer::tag('div', $leftcontent, array('class' => 'left side'));
@ -225,7 +222,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
$classes = '';
}
$sectionname = html_writer::tag('span', $this->section_title($section, $course));
$o.= $this->output->heading($sectionname, 3, 'sectionname' . $classes);
$o .= $this->output->heading($sectionname, 3, 'sectionname' . $classes, "sectionid-{$section->id}-title");
$o .= $this->section_availability($section);