add aria attributes

fixes #1810
This commit is contained in:
daria 2026-05-21 11:57:11 +03:00
parent 0bb403988f
commit ab252784f2
No known key found for this signature in database
GPG Key ID: 3B75240E6B2F2701
2 changed files with 16 additions and 2 deletions

View File

@ -134,6 +134,8 @@ define(req, function(AppConfig, Default, Language) {
}
};
Messages.kanban_quickView = "Minimize card content"; // XXX
Messages.kanban_fullView = "Show card content";
return Messages;
});

View File

@ -1107,16 +1107,28 @@ define([
var $cContainer = $('#cp-app-kanban-container');
var addControls = function () {
// Quick or normal mode
var small = h('button.cp-kanban-view-small', Icons.get('kanban-minimize'));
var big = h('button.cp-kanban-view', Icons.get('kanban-maximize'));
var small = h('button.cp-kanban-view-small', Icons.get('kanban-minimize'), {
'title': Messages.kanban_quickView,
'aria-label': Messages.kanban_quickView,
'aria-pressed': $cContainer.hasClass('cp-kanban-quick') ? 'true' : 'false'
});
var big = h('button.cp-kanban-view', Icons.get('kanban-maximize'), {
'title': Messages.kanban_fullView,
'aria-label': Messages.kanban_fullView,
'aria-pressed': $cContainer.hasClass('cp-kanban-quick') ? 'false' : 'true'
});
$(small).click(function () {
if ($cContainer.hasClass('cp-kanban-quick')) { return; }
$cContainer.addClass('cp-kanban-quick');
small.setAttribute('aria-pressed', 'true');
big.setAttribute('aria-pressed', 'false');
//framework._.sfCommon.setPadAttribute('quickMode', true);
});
$(big).click(function () {
if (!$cContainer.hasClass('cp-kanban-quick')) { return; }
$cContainer.removeClass('cp-kanban-quick');
small.setAttribute('aria-pressed', 'false');
big.setAttribute('aria-pressed', 'true');
//framework._.sfCommon.setPadAttribute('quickMode', false);
});