Skip to content
Snippets Groups Projects
Commit ae48076d authored by Viola Elsenhans's avatar Viola Elsenhans Committed by Robert Lange
Browse files

refs #22289 [fid_adlr] add aria-label for data range slider

* add id to data range slider
parent 094d048b
No related merge requests found
......@@ -6,12 +6,13 @@
<input type="hidden" name="<?=$this->escapeHtmlAttr($this->facet['type'])?>range[]" value="<?=$this->escapeHtmlAttr($this->title)?>"/>
<?php /* fid_adlr: place slider here instead of further down */ ?>
<?php if ($this->facet['type'] == 'date'): ?>
<div class="slider-container"><input type="text" class="hidden" id="<?=$this->escapeHtmlAttr($this->title)?><?=$this->escapeHtml($this->facet['type'])?>Slider"/></div>
<div class="slider-container"><input type="text" class="hidden" id="<?=$this->escapeHtmlAttr($this->title)?><?=$this->escapeHtml($this->facet['type'])?>Slider" aria-label="<?=$this->transEsc('Range-from-to')?>"/></div>
<?php endif; ?>
<div class="date-fields">
<?php $extraInputAttribs = ($this->facet['type'] == 'date') ? 'maxlength="4" ' : ''; ?>
<div class="date-from">
<label for="<?=$this->escapeHtmlAttr($this->title)?>from">
<?php /* finc adds label ids */ ?>
<label id="from-label" for="<?=$this->escapeHtmlAttr($this->title)?>from">
<?php /* fid_adlr: modify result list; remove colon #15967 */ ?>
<?=$this->transEsc('date_from')?>
</label>
......@@ -19,7 +20,7 @@
<input type="number" class="form-control" name="<?=$this->escapeHtmlAttr($this->title)?>from" id="<?=$this->escapeHtmlAttr($this->title)?>from" value="<?=isset($this->facet['values'][0]) ? $this->escapeHtmlAttr($this->facet['values'][0]) : ''?>" <?=$extraInputAttribs?>/>
</div>
<div class="date-to">
<label for="<?=$this->escapeHtmlAttr($this->title)?>to">
<label id="to-label" for="<?=$this->escapeHtmlAttr($this->title)?>to">
<?php /* fid_adlr: modify result list; remove colon #15967 */ ?>
<?=$this->transEsc('date_to')?>
</label>
......@@ -56,6 +57,9 @@ $(document).ready(function() {
})
.on('change', fillTexts)
.data('slider');
// finc: set aria-labelledby by id #18936
$(".slider-handle.min-slider-handle").attr("aria-labelledby", "from-label");
$(".slider-handle.max-slider-handle").attr("aria-labelledby", "to-label");
});
$('#{$this->escapeHtmlAttr($this->title)}from, #{$this->escapeHtmlAttr($this->title)}to').change(function () {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment