mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 18:06:51 +02:00
Merge branch 'MDL-70004-39' of git://github.com/junpataleta/moodle into MOODLE_39_STABLE
This commit is contained in:
commit
a5293c4ed8
4 changed files with 6 additions and 6 deletions
|
@ -1,2 +1,2 @@
|
|||
define ("qtype_multichoice/clearchoice",["jquery","core/custom_interaction_events"],function(a,b){var c={CHOICE_ELEMENT:".answer input",LINK:"label",RADIO:"input[type=\"radio\"]"},d=function(a){a.find(c.RADIO).prop("disabled",!1).prop("checked",!0)},e=function(a,b){return a.find("div[id=\""+b+"\"]")},f=function(a){a.addClass("sr-only");a.attr("aria-hidden",!0);a.find(c.LINK).attr("tabindex",-1)},g=function(a){a.removeClass("sr-only");a.removeAttr("aria-hidden");a.find(c.LINK).attr("tabindex",0);a.find(c.RADIO).prop("disabled",!0)},h=function(a,h){var i=e(a,h);i.on(b.events.activate,c.LINK,function(a,b){d(i);f(i);b.originalEvent.preventDefault()});a.on("change",c.CHOICE_ELEMENT,function(){g(i)});i.find(c.RADIO).focus(function(){var b=a.find(c.CHOICE_ELEMENT).first();b.focus()})};return{init:function init(b,c){b=a("#"+b);h(b,c)}}});
|
||||
define ("qtype_multichoice/clearchoice",["jquery","core/custom_interaction_events"],function(a,b){var c={CHOICE_ELEMENT:".answer input",LINK:"a",RADIO:"input[type=\"radio\"]"},d=function(a){a.find(c.RADIO).prop("disabled",!1).prop("checked",!0)},e=function(a,b){return a.find("div[id=\""+b+"\"]")},f=function(a){a.addClass("sr-only");a.attr("aria-hidden",!0);a.find(c.LINK).attr("tabindex",-1)},g=function(a){a.removeClass("sr-only");a.removeAttr("aria-hidden");a.find(c.LINK).attr("tabindex",0);a.find(c.RADIO).prop("disabled",!0)},h=function(a,h){var i=e(a,h);i.on(b.events.activate,c.LINK,function(a,b){d(i);f(i);b.originalEvent.preventDefault()});a.on("change",c.CHOICE_ELEMENT,function(){g(i)});i.find(c.RADIO).focus(function(){var b=a.find(c.CHOICE_ELEMENT).first();b.focus()})};return{init:function init(b,c){b=a("#"+b);h(b,c)}}});
|
||||
//# sourceMappingURL=clearchoice.min.js.map
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -25,7 +25,7 @@ define(['jquery', 'core/custom_interaction_events'], function($, CustomEvents) {
|
|||
|
||||
var SELECTORS = {
|
||||
CHOICE_ELEMENT: '.answer input',
|
||||
LINK: 'label',
|
||||
LINK: 'a',
|
||||
RADIO: 'input[type="radio"]'
|
||||
};
|
||||
|
||||
|
|
|
@ -313,9 +313,9 @@ class qtype_multichoice_single_renderer extends qtype_multichoice_renderer_base
|
|||
}
|
||||
// Adds an hidden radio that will be checked to give the impression the choice has been cleared.
|
||||
$clearchoiceradio = html_writer::empty_tag('input', $clearchoiceradioattrs);
|
||||
$clearchoiceradio .= html_writer::tag('label', get_string('clearchoice', 'qtype_multichoice'),
|
||||
['for' => $clearchoiceid, 'role' => 'button', 'tabindex' => $linktabindex,
|
||||
'class' => 'btn btn-link ml-4 pl-1 mt-2']);
|
||||
$clearchoice = html_writer::link('#', get_string('clearchoice', 'qtype_multichoice'),
|
||||
['tabindex' => $linktabindex, 'role' => 'button', 'class' => 'btn btn-link ml-3 mt-n1 mb-n1']);
|
||||
$clearchoiceradio .= html_writer::label($clearchoice, $clearchoiceid);
|
||||
|
||||
// Now wrap the radio and label inside a div.
|
||||
$result = html_writer::tag('div', $clearchoiceradio, $clearchoicewrapperattrs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue