Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue #14332: Expression manager broken in Bootstrap buttons
Dev: rewriting using existing EM system
- Loading branch information
Showing
10 changed files
with
35 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 1 addition & 12 deletions
13
...n/bootstrap_buttons/survey/questions/answer/listradio/assets/scripts/bootstrapbuttons.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1 @@ | ||
.bootstrap-item input { | ||
visibility:hidden !important; | ||
display: none !important; | ||
} | ||
|
||
.bootstrap-item { | ||
margin: 2px 2px; | ||
} | ||
|
||
.bootstrap-buttons-div { | ||
padding: 0 2px; | ||
} | ||
.bootstrap-buttons-div{margin-bottom:0.2em} /* Usage of em since we don't know size set by theme */ |
47 changes: 13 additions & 34 deletions
47
...on/bootstrap_buttons/survey/questions/answer/listradio/assets/scripts/bootstrapbuttons.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(''); | ||
} | ||
}); | ||
}); | ||
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"); | ||
} | ||
}); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters