MDL-69453 core_form: improve form UI icons and alignment
[moodle.git] / lib / form / templates / element-filepicker.mustache
blob9d6ff8b817be6eb8f5ea15757384a221b2a58e9e
1 {{< core_form/element-template }}
2     {{$label}}
3         {{^element.hiddenlabel}}
4             <p id="{{element.id}}_label" class="mb-0 d-inline" aria-hidden="true">
5                 {{{label}}}
6             </p>
7         {{/element.hiddenlabel}}
8     {{/label}}
9     {{$element}}
10         <fieldset class="w-100 m-0 p-0 border-0" id="{{element.id}}_fieldset">
11             <legend class="sr-only">{{label}}</legend>
12             {{{element.html}}}
13         </fieldset>
14     {{/element}}
15 {{/ core_form/element-template }}
16 {{#js}}
17 (function() {
18     var label = document.getElementById('{{element.id}}_label');
19     if (label) {
20         label.style.cursor = 'default';
21         label.addEventListener('click', function() {
22             document.querySelectorAll('#{{element.id}}_fieldset .fp-btn-choose')[0].focus();
23         });
24     }
25 })();
26 {{/js}}