Commits (3)
......@@ -16,7 +16,7 @@
<supportUrl>https://extensions.sondages.pro/themes-and-templates/skelvanilla-a11y-and-usuability/</supportUrl>
<copyright>Copyright (C) 2018-2020 Denis Chenu / Sondages Pro</copyright>
<license>GNU General Public License version 3 or later</license>
<version>10.9.1</version>
<version>10.9.2</version>
<apiVersion>3</apiVersion>
<description><![CDATA[<strong>LimeSurvey Bootstrap Vanilla Survey Theme with Accessibility and Options</strong><br>Base on vanilla theme, usage of more aria, fix some role and aria from core.<br>Allow usage of variations, only two variation in this lignt version.]]></description>
<extends>vanilla</extends>
......
......@@ -37,17 +37,17 @@ var TemplateAccessible = {
triggerEmClassChangeAccessible: function () {
/* @todo : check :valid and setCustomValidity */
$(document).on('classChangeError','.ls-em-tip', function () {
if($(this).attr("role") != "alert") {
parentId = $(this).parent('.ls-question-help').attr("id");
var parentId = $(this).parent('.ls-question-help').attr("id");
if($("#" + parentId).attr("role") != "alert") {
$("#" + parentId).attr("role","alert");
$("[aria-describedby*='"+parentId+"']").attr("aria-invalid",true);
$("[aria-labelledby*='"+parentId+"']").attr("aria-invalid",true);
$(this).attr("role","alert");
}
});
$(document).on('classChangeGood','.ls-em-tip', function () {
$(this).removeAttr("role");
if($(this).parent('.ls-question-help').find(".ls-em-error").length == 0) {
parentId = $(this).parent('.ls-question-help').attr("id");
var parentId = $(this).parent('.ls-question-help').attr("id");
if($("#" + parentId).attr("role") == "alert" && $(this).parent('.ls-question-help').find(".ls-em-error").length == 0) {
$("#" + parentId).removeAttr("role");
$("[aria-describedby*='"+parentId+"']").removeAttr("aria-invalid");
$("[aria-labelledby*='"+parentId+"']").removeAttr("aria-invalid");
}
......
/* @version 10.8.3 */
/* @version 10.9.2 */
var skelVanilla = {
init : function (options) {
this.languageChanger();
......@@ -22,7 +22,6 @@ var skelVanilla = {
},
languageChanger : function () {
$('.form-change-lang [name="lang"]').on('change', function(event) {
console.warn($(this).data("limesurvey-lastkey"));
if( $(this).data("limesurvey-lastkey") == 38 || $(this).data("limesurvey-lastkey") == 40 || $(this).data("limesurvey-lastkey") == 9) {
$(this).data("limesurvey-lastkey", 38)
}
......@@ -230,7 +229,7 @@ var skelVanilla = {
$(function() {
if($("header.navbar-fixed-top").length) {
var fixedHeaderHeight = $("header.navbar-fixed-top").height();
$('.table-fixed-header .ls-answers > thead > tr > td,.table-fixed-header .ls-answers > thead > tr > th').each(function() {
$('.table-fixed-header .ls-answers > thead > tr > td,.table-fixed-header .ls-answers > thead > tr > th,.table-fixed-header .ls-answers > tbody > tr.ls-header > td').each(function() {
$(this).css("top",fixedHeaderHeight+"px");
$(this).css("z-index",1040);
});
......@@ -239,7 +238,7 @@ var skelVanilla = {
$( window ).resize(function() {
if($("header.navbar-fixed-top").length) {
var fixedHeaderHeight = $("header.navbar-fixed-top").height();
$('.table-fixed-header .ls-answers > thead > tr > td,.table-fixed-header .ls-answers > thead > tr > th').each(function() {
$('.table-fixed-header .ls-answers > thead > tr > td,.table-fixed-header .ls-answers > thead > tr > th,.table-fixed-header .ls-answers > tbody > tr.ls-header > td').each(function() {
$(this).css("top",fixedHeaderHeight+"px");
});
}
......