diff --git a/assets/scripts/expressions/em_javascript.js b/assets/scripts/expressions/em_javascript.js index ed9e5812eeb..dc92b828944 100644 --- a/assets/scripts/expressions/em_javascript.js +++ b/assets/scripts/expressions/em_javascript.js @@ -43,7 +43,7 @@ $(document).on("change",".radio-item :radio:not([onclick]), .button-item :radio: checkconditions($(this).val(), $(this).attr('name'), 'radio', 'click') }); /* checkbox item */ -$(document).on("change",".checkbox-item :checkbox:not([onclick])",function(event){ +$(document).on("change",".checkbox-item :checkbox:not([onclick]),.button-item :checkbox:not([onclick])",function(event){ checkconditions($(this).val(), $(this).attr('name'), 'checkbox', 'click') }); diff --git a/themes/question/bootstrap_buttons/survey/questions/answer/listradio/answer.twig b/themes/question/bootstrap_buttons/survey/questions/answer/listradio/answer.twig index b89fcbc060f..0df2830fabd 100644 --- a/themes/question/bootstrap_buttons/survey/questions/answer/listradio/answer.twig +++ b/themes/question/bootstrap_buttons/survey/questions/answer/listradio/answer.twig @@ -8,13 +8,10 @@ #} - {{ sTimer }} - -
-
- +
+
{# rows/answer_row.php #} {{ sRows }} @@ -26,17 +23,13 @@ }}
{# Must add it only of other is set ! #} -
- - - {{ gT('Other:') }} +
+
diff --git a/themes/question/bootstrap_buttons/survey/questions/answer/listradio/assets/scripts/bootstrapbuttons.css b/themes/question/bootstrap_buttons/survey/questions/answer/listradio/assets/scripts/bootstrapbuttons.css index 8419acfc4b0..ea38af0d382 100644 --- a/themes/question/bootstrap_buttons/survey/questions/answer/listradio/assets/scripts/bootstrapbuttons.css +++ b/themes/question/bootstrap_buttons/survey/questions/answer/listradio/assets/scripts/bootstrapbuttons.css @@ -1,12 +1 @@ -.bootstrap-item input { - visibility:hidden !important; - display: none !important; -} - - .bootstrap-item { - margin: 2px 2px; -} - - .bootstrap-buttons-div { - padding: 0 2px; - } \ No newline at end of file +.bootstrap-buttons-div{margin-bottom:0.2em} /* Usage of em since we don't know size set by theme */ diff --git a/themes/question/bootstrap_buttons/survey/questions/answer/listradio/assets/scripts/bootstrapbuttons.js b/themes/question/bootstrap_buttons/survey/questions/answer/listradio/assets/scripts/bootstrapbuttons.js index d42c98df19c..3d8fd230ee6 100644 --- a/themes/question/bootstrap_buttons/survey/questions/answer/listradio/assets/scripts/bootstrapbuttons.js +++ b/themes/question/bootstrap_buttons/survey/questions/answer/listradio/assets/scripts/bootstrapbuttons.js @@ -1,34 +1,13 @@ -/* - * This file is part of LimeSurvey - * See COPYRIGHT.php for copyright notices and details. - * @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GNU/GPL License v2 or later - * - * This javascript updates value of "other" input field, shows "other" input field when "Other" radio button is checked - * and triggers validation - */ - - - -$( document ).ready(function() { - $(".bootstrap-radio-value").each( function( index, element ){ - if ($(this).val()){ - name = $(this).data('name'); - // "other" input field - $("#answer" + name + "othertext").val($(this).val()); - $("#" + name + "-div").removeClass('hide'); - // execute validation - checkconditions($(this).val(), name, this.type); - } - }); - - $(".bootstrap-radio").change(function(){ - name = $(this).attr('name'); - // conditionaly show or hide "other" input field - if ($(this).val() === '-oth-'){ - $("#" + name + "-div").removeClass('hide'); - } else { - $("#" + name + "-div").addClass('hide'); - $("#answer" + name + "othertext").val(''); - } - }); -}); \ No newline at end of file +function doBootstrapRadio(){ + $(".button-item .bootstrap-radio").change(function(){ + name = $(this).attr('name'); + // conditionaly show or hide "other" input field + if ($(this).val() === '-oth-'){ + $("#div" + name + "other").removeClass('ls-js-hidden'); + } else { + $("#div" + name + "other").addClass('ls-js-hidden'); + $("#answer" + name + "othertext").val('').trigger("change"); + } + }); + +} diff --git a/themes/question/bootstrap_buttons/survey/questions/answer/listradio/rows/answer_row.twig b/themes/question/bootstrap_buttons/survey/questions/answer/listradio/rows/answer_row.twig index 8e1578aea04..d98490019cb 100644 --- a/themes/question/bootstrap_buttons/survey/questions/answer/listradio/rows/answer_row.twig +++ b/themes/question/bootstrap_buttons/survey/questions/answer/listradio/rows/answer_row.twig @@ -15,9 +15,9 @@
-
+
-
+
-
+
-
-
+ - diff --git a/themes/question/bootstrap_buttons/survey/questions/answer/multiplechoice/assets/scripts/bootstrapbuttons.js b/themes/question/bootstrap_buttons/survey/questions/answer/multiplechoice/assets/scripts/bootstrapbuttons.js index 64d332fc5e1..35c54cdd4b4 100644 --- a/themes/question/bootstrap_buttons/survey/questions/answer/multiplechoice/assets/scripts/bootstrapbuttons.js +++ b/themes/question/bootstrap_buttons/survey/questions/answer/multiplechoice/assets/scripts/bootstrapbuttons.js @@ -10,19 +10,6 @@ $( document ).ready(function() { - - // ROW - $(".bootstrap-checkbox").change(function(){ - name = $(this).data('name'); - // set value for java element - if ($(this).is(':checked')){ - $("#java" + name).val('Y'); - } else { - $("#java" + name).val(''); - } - checkconditions(this.value, this.name, this.type); - }); - // OTHER $(".bootstrap-checkbox-other-value").each( function( index, element ){ name = $(this).data('name'); diff --git a/themes/question/bootstrap_buttons/survey/questions/answer/multiplechoice/rows/answer_row.twig b/themes/question/bootstrap_buttons/survey/questions/answer/multiplechoice/rows/answer_row.twig index 2367578fcf4..30c2f0ce36d 100644 --- a/themes/question/bootstrap_buttons/survey/questions/answer/multiplechoice/rows/answer_row.twig +++ b/themes/question/bootstrap_buttons/survey/questions/answer/multiplechoice/rows/answer_row.twig @@ -21,12 +21,12 @@
-
+
-
+