Skip to content

Commit

Permalink
Dev: reapplied Bootstrap switch to some views
Browse files Browse the repository at this point in the history
  • Loading branch information
lacrioque committed Jul 30, 2018
1 parent 87cc7e6 commit 2b29219
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 13 deletions.
27 changes: 14 additions & 13 deletions application/views/admin/dataentry/vvimport.php
Expand Up @@ -143,17 +143,18 @@
<?php } ?>

</div></div></div>

<script>
$(document).ready(function() {
$('#noid').on('switchChange.bootstrapSwitch', function(event, state) {
if (!state){
$('#insertmethod').removeAttr('disabled');
$('#insertmethod-container').show('slow');
}else{
$('#insertmethod').attr('disabled','disabled');
$('#insertmethod-container').hide('slow');
}
});
<?php
App()->getClientScript()->registerScript('StatisticsViewBSSwitcher', "
LS.renderBootstrapSwitch();
$('#noid').on('switchChange.bootstrapSwitch', function(event, state) {
if (!state){
$('#insertmethod').removeAttr('disabled');
$('#insertmethod-container').show('slow');
}else{
$('#insertmethod').attr('disabled','disabled');
$('#insertmethod-container').hide('slow');
}
});
</script>
", LSYii_ClientScript::POS_POSTSCRIPT);
?>
5 changes: 5 additions & 0 deletions application/views/admin/export/exportresults_view.php
Expand Up @@ -57,3 +57,8 @@
<input type='submit' class="btn btn-default hidden" value='<?php eT("Export data");?>' id='exportresultsubmitbutton' />
</form>
</div>
<?php
App()->getClientScript()->registerScript('ExportResultsBSSwitcher', "
LS.renderBootstrapSwitch();
", LSYii_ClientScript::POS_POSTSCRIPT);
?>
5 changes: 5 additions & 0 deletions application/views/admin/export/statistics_view.php
Expand Up @@ -142,3 +142,8 @@
</div>
</div>
</div>
<?php
App()->getClientScript()->registerScript('StatisticsViewBSSwitcher', "
LS.renderBootstrapSwitch();
", LSYii_ClientScript::POS_POSTSCRIPT);
?>
3 changes: 3 additions & 0 deletions application/views/admin/globalSettings_view.php
Expand Up @@ -7,6 +7,9 @@
echo viewHelper::getViewTestTag('globalsettings');

App()->getClientScript()->registerPackage('jquery-selectboxes');
App()->getClientScript()->registerScript('GlobalSettingsBSSwitcher', "
LS.renderBootstrapSwitch();
", LSYii_ClientScript::POS_POSTSCRIPT);

?>
<script type="text/javascript">
Expand Down
5 changes: 5 additions & 0 deletions application/views/admin/homepagesettings/index.php
Expand Up @@ -4,6 +4,11 @@

// DO NOT REMOVE This is for automated testing to validate we see that page
echo viewHelper::getViewTestTag('homepageSettings');

App()->getClientScript()->registerScript('HomepageSettingsBSSwitcher', "
LS.renderBootstrapSwitch();
", LSYii_ClientScript::POS_POSTSCRIPT);

?>
<script type="text/javascript">
strConfirm='<?php eT('Please confirm','js');?>';
Expand Down
Expand Up @@ -133,5 +133,9 @@
<?php
$aModalData = ['aAttributes' => $aAttributes];
App()->getController()->renderPartial('/admin/participants/modal_subviews/_exportCSV', $aModalData);

App()->getClientScript()->registerScript('ParticipantsPanelBSSwitcher', "
LS.renderBootstrapSwitch();
", LSYii_ClientScript::POS_POSTSCRIPT);
?>

5 changes: 5 additions & 0 deletions application/views/admin/survey/queXMLSurvey_view.php
Expand Up @@ -195,3 +195,8 @@
</div>
</form>
</div>
<?php
App()->getClientScript()->registerScript('GlobalSettingsBSSwitcher', "
LS.renderBootstrapSwitch();
", LSYii_ClientScript::POS_POSTSCRIPT);
?>

0 comments on commit 2b29219

Please sign in to comment.