MDL-67970 output: replace new-sections attribute with data-new-sections

new-sections is not a valid attribute name for the a element.
Replaced that with data-new-sections
This commit is contained in:
Shamim Rezaie 2020-02-27 01:46:07 +11:00
parent b48b4d2244
commit 4d0e97c781
4 changed files with 4 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -567,7 +567,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
str.get_string('numberweeks').done(function(strNumberSections) {
var trigger = $(SELECTOR.ADDSECTIONS),
modalTitle = trigger.attr('data-add-sections'),
newSections = trigger.attr('new-sections');
newSections = trigger.attr('data-new-sections');
var modalBody = $('<div><label for="add_section_numsections"></label> ' +
'<input id="add_section_numsections" type="number" min="1" max="' + newSections + '" value="1"></div>');
modalBody.find('label').html(strNumberSections);

View File

@ -978,7 +978,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
$icon = $this->output->pix_icon('t/add', '');
$newsections = $maxsections - $lastsection;
echo html_writer::link($url, $icon . $straddsections,
array('class' => 'add-sections', 'data-add-sections' => $straddsections, 'new-sections' => $newsections));
array('class' => 'add-sections', 'data-add-sections' => $straddsections, 'data-new-sections' => $newsections));
echo html_writer::end_tag('div');
}
}