mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-12 19:49:59 +05:00
Fix conflicting id attributes in forms
This commit is contained in:
parent
4f834ce5e8
commit
fc21305b81
@ -752,7 +752,7 @@ define([
|
||||
}
|
||||
var day = _date && allDays[_date.getDay()];
|
||||
return h('div.cp-poll-cell.cp-form-poll-option', {
|
||||
id: 'cp-form-option-' + index,
|
||||
'data-index': index,
|
||||
title: data,
|
||||
}, [
|
||||
opts.type === 'day' ? h('span.cp-form-weekday', day) : undefined,
|
||||
@ -1067,6 +1067,8 @@ define([
|
||||
APP.common.openUnsafeURL(href);
|
||||
};
|
||||
|
||||
const pollLabels = [Messages.forms_pollOptionNo, Messages.forms_pollOptionYes, Messages.forms_pollOptionMaybe];
|
||||
|
||||
var STATIC_TYPES = {
|
||||
md: {
|
||||
defaultOpts: {
|
||||
@ -2659,9 +2661,9 @@ define([
|
||||
var disabled = false;
|
||||
|
||||
var updateAriaLabel = function ($c, val, index) {
|
||||
const labels = [Messages.forms_pollOptionNo, Messages.forms_pollOptionYes, Messages.forms_pollOptionMaybe];
|
||||
const currentLabelText = $('#cp-form-option-' + index).text().trim();
|
||||
$c.attr('aria-label', currentLabelText + ', ' + labels[val]);
|
||||
//const currentLabelText = $('#cp-form-option-' + index).text().trim();
|
||||
const optionLabel = $c.closest('.cp-form-type-poll').find(`.cp-form-poll-option[data-index=${index}] span`).text().trim();
|
||||
$c.attr('aria-label', optionLabel + ', ' + pollLabels[val]);
|
||||
};
|
||||
// Add form
|
||||
var addLine = extractValues(opts.values).map(function (data,index) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user