mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
add screen reader support for Swap axes button
This commit is contained in:
parent
8d8e314787
commit
522b06366e
@ -145,6 +145,9 @@ define(req, function(AppConfig, Default, Language) {
|
||||
Messages.hide_password = "Hide password";
|
||||
Messages.next_templateList = "Next template list";
|
||||
Messages.previous_templateList = "Previous template list";
|
||||
|
||||
Messages.forms_switchHorizontalAxe = 'Switch to horizontal layout';
|
||||
Messages.forms_switchVerticalAxe = 'Switch to vertical layout';
|
||||
return Messages;
|
||||
|
||||
});
|
||||
|
||||
@ -759,7 +759,10 @@ define([
|
||||
]);
|
||||
});
|
||||
// Insert axis switch button
|
||||
var switchAxis = h('button.btn.btn-default', [
|
||||
var switchAxis = h('button.btn.btn-default', {
|
||||
'aria-pressed': 'false',
|
||||
'aria-label': Messages.forms_switchVerticalAxe
|
||||
}, [
|
||||
Messages.form_poll_switch,
|
||||
h('i.fa.fa-exchange'),
|
||||
]);
|
||||
@ -837,6 +840,9 @@ define([
|
||||
|
||||
var $s = $(switchAxis).click(function () {
|
||||
$s.closest('.cp-form-type-poll').toggleClass('cp-form-poll-switch');
|
||||
var pressed = $s.attr('aria-pressed') === 'true';
|
||||
$s.attr('aria-pressed', !pressed);
|
||||
$s.attr('aria-label', !pressed ? Messages.forms_switchHorizontalAxe : Messages.forms_switchVerticalAxe );
|
||||
});
|
||||
|
||||
return lines;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user