Commit 9ce5e80d authored by Chenu Denis's avatar Chenu Denis

[fix] Multiple with comment mandatory

parent 43262224
......@@ -15,10 +15,10 @@
<supportUrl>https://extensions.sondages.pro/themes-and-templates/skelvanilla-a11y-and-usuability/?var_mode=calcul</supportUrl>
<copyright>Copyright (C) 2018 Denis Chenu / Sondages Pro</copyright>
<license>GNU General Public License version 3 or later</license>
<version>4.7.3</version>
<version>4.7.5</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 a lot of variations, list of variation can be updated. Some decoration option using boostrap class.]]></description>
<last_update>2019-05-12 12:02:46</last_update>
<last_update>2019-05-12 12:54:30</last_update>
<extends>vanilla</extends>
</metadata>
......
......@@ -4,7 +4,9 @@
* @author Denis Chenu <https://sondages.pro
* @license magnet:?xt=urn:btih:c80d50af7d3db9be66a4d0a86db0286e4fd33292&dn=bsd-3-clause.txt BSD 3 Clause
*/
var TemplateAccessible = {
requiredSelector : '.text-item:not(.other-text-item):not(.slider-item) input:text,.text-item:not(.other-text-item):not(.comment-item) textarea,.dropdown-item select,.radio-item input:radio',
init : function (options) {
if(options.dynamicValidity) {
this.disableValidityCheck();
......@@ -47,7 +49,7 @@ var TemplateAccessible = {
},
setMandatoryRequired: function() {
$("[id^='question'].mandatory").each(function() {
$(this).find('.text-item:not(.other-text-item):not(.slider-item) input:text,.text-item:not(.other-text-item) textarea,.dropdown-item select,.radio-item input:radio').attr('required',true);
$(this).find(TemplateAccessible.requiredSelector).attr('required',true);
});
},
setDynamicValidity : function () {
......@@ -73,19 +75,19 @@ var TemplateAccessible = {
triggerRelevanceValidity: function() {
$(document).on('relevance:on',"[id^='question'].mandatory",function(event,data) {
if(event.target != this) return;
$(this).find('..text-item:not(.other-text-item) input:text,.text-item:not(.other-text-item) textarea,.dropdown-item select,.radio-item input:radio').attr('required',true);
$(this).find(TemplateAccessible.requiredSelector).attr('required',true);
});
$(document).on('relevance:off',"[id^='question'].mandatory",function(event,data) {
if(event.target != this) return;
$(this).find('.text-item:not(.other-text-item) input:text,.text-item:not(.other-text-item) textarea,.dropdown-item select,.radio-item input:radio').removeAttr('required');
$(this).find(TemplateAccessible.requiredSelector).removeAttr('required');
});
$("[id^='question'].mandatory").on('relevance:on',"[id^='javatbd']",function(event,data) {
if(event.target != this) return;
$(this).find('.text-item:not(.other-text-item) input:text,.text-item:not(.other-text-item) textarea,.dropdown-item select,.radio-item input:radio').attr('required',true);
$(this).find(TemplateAccessible.requiredSelector).attr('required',true);
});
$("[id^='question'].mandatory").on('relevance:off',"[id^='javatbd']",function(event,data) {
if(event.target != this) return;
$(this).find('.text-item:not(.other-text-item) input:text,.text-item:not(.other-text-item) textarea,.dropdown-item select,.radio-item input:radio').removeAttr('required');
$(this).find(TemplateAccessible.requiredSelector).removeAttr('required');
});
},
triggerHtmlUpdated : function() {
......
Markdown is supported
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