MDL-69116 qtype_mutichoice: Use label for the "clear my choice" link
This commit is contained in:
+1
-1
@@ -1,2 +1,2 @@
|
||||
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.find(c.LINK).attr("tabindex",-1)},g=function(a){a.removeClass("sr-only");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(b.events.activate,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:"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.find(c.LINK).attr("tabindex",-1)},g=function(a){a.removeClass("sr-only");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(b.events.activate,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: 'a',
|
||||
LINK: 'label',
|
||||
RADIO: 'input[type="radio"]'
|
||||
};
|
||||
|
||||
|
||||
@@ -302,7 +302,7 @@ 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::link('', get_string('clearchoice', 'qtype_multichoice'),
|
||||
$clearchoiceradio .= html_writer::tag('label', get_string('clearchoice', 'qtype_multichoice'),
|
||||
['for' => $clearchoiceid, 'role' => 'button', 'tabindex' => $linktabindex]);
|
||||
|
||||
// Now wrap the radio and label inside a div.
|
||||
|
||||
@@ -307,7 +307,7 @@ body.path-question-type {
|
||||
}
|
||||
.qtype_multichoice_clearchoice {
|
||||
padding-top: 10px;
|
||||
a {
|
||||
label {
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
padding-left: 30px;
|
||||
|
||||
@@ -15094,7 +15094,7 @@ body.path-question-type {
|
||||
|
||||
.qtype_multichoice_clearchoice {
|
||||
padding-top: 10px; }
|
||||
.qtype_multichoice_clearchoice a {
|
||||
.qtype_multichoice_clearchoice label {
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
padding-left: 30px; }
|
||||
|
||||
@@ -15341,7 +15341,7 @@ body.path-question-type {
|
||||
|
||||
.qtype_multichoice_clearchoice {
|
||||
padding-top: 10px; }
|
||||
.qtype_multichoice_clearchoice a {
|
||||
.qtype_multichoice_clearchoice label {
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
padding-left: 30px; }
|
||||
|
||||
Reference in New Issue
Block a user