Commit ed02b7f9 authored by Théo GUILLON's avatar Théo GUILLON
Browse files

Correction : scroll

Modification : valeur des champs afficher pour la soustraitance
parent 272bc7d2
<?php
echo $this->Html->script([
'smalot-bootstrap-datetimepicker/js/bootstrap-datetimepicker.min',
'smalot-bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.fr.js'
]);
echo $this->Html->css('/js/smalot-bootstrap-datetimepicker/css/bootstrap-datetimepicker.min');
?>
<!-- Onglet Co-responsable -->
<div id="ongletComplementaireCoresponsable" class="tab-pane">
<br>
......
......@@ -122,6 +122,14 @@ if (isset($this->validationErrors['WebdpoSoustraitance']) ) {
$(eventSelect).on("select2:select", function (e) {
let idSelect = e.params.data.id;
createCardSoustraitant(templateFieldsSoustraitance, infoSoustraitances, idSelect);
$('.calendar').datetimepicker({
viewMode: 'year',
startView: 'decade',
format: 'dd/mm/yyyy',
minView: 2,
language: 'fr'
});
});
$(eventSelect).on("select2:unselect", function (e) {
......@@ -133,6 +141,15 @@ if (isset($this->validationErrors['WebdpoSoustraitance']) ) {
$('input[type="hidden"][name="data[Soustraitance][currentSoustraitance]['+id+'][soustraitant_id]"]').remove();
$('input[type="hidden"][name="data[Soustraitance][currentSoustraitance]['+id+'][soustraitance_id]"]').remove();
});
$('.calendar').datetimepicker({
viewMode: 'year',
startView: 'decade',
format: 'dd/mm/yyyy',
minView: 2,
language: 'fr'
});
});
function createCardSoustraitant(templateFieldsSoustraitance, infoSoustraitances, idSelect, soustraitancefieldsRequestData = null) {
......@@ -208,15 +225,30 @@ if (isset($this->validationErrors['WebdpoSoustraitance']) ) {
// On attribut la valeur au champ si il y en a une.
if (soustraitancefieldsRequestData !== null) {
$.each(soustraitancefieldsRequestData[idSelect], function (key, val) {
let fieldId = '#st_' + idSelect + '_' + key;
if (jQuery.isArray(val)) {
let ifMultiSelect = $(fieldId + '[name="data[WebdpoSoustraitance]['+idSelect+']['+key+'][]"]');
$.each(val, function (k, v) {
$('#' + key + v).attr("checked", "checked");
if (ifMultiSelect.length) {
$(fieldId + ' option[value="' + v + '"]').prop("selected", true);
} else {
$('#' + key + v).prop("checked", true);
}
});
} else {
$('#st_'+idSelect+'_'+key).val(val);
let ifRadio = $('input[type="radio"][name="data[WebdpoSoustraitance]['+idSelect+']['+key+']"][value="'+val+'"]');
if (ifRadio.length) {
$(ifRadio).prop("checked",true);
} else {
$(fieldId).val(val);
}
}
});
}
}
</script>
\ No newline at end of file
<?php
echo $this->Html->script('jquery-mask-plugin/dist/jquery.mask.min.js');
debug($this->request->data);
echo $this->Html->script([
'smalot-bootstrap-datetimepicker/js/bootstrap-datetimepicker.min',
'smalot-bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.fr.js',
'jquery-mask-plugin/dist/jquery.mask.min.js'
]);
echo $this->Html->css('/js/smalot-bootstrap-datetimepicker/css/bootstrap-datetimepicker.min');
if (isset($this->validationErrors['WebdpoFiche']) && !empty($this->validationErrors['WebdpoFiche']) ||
isset($this->validationErrors['WebdpoCoresponsable']) && !empty($this->validationErrors['WebdpoCoresponsable']) ||
......
......@@ -6,12 +6,14 @@ $(document).ready(function () {
forScrollWidth = $(forScroll).width(),
navbarHeight = $('div.navbar-fixed-top').height();
$(forScroll).removeClass('fixed');
$(forScroll).css('width', '');
if (forScroll.length) {
$(forScroll).removeClass('fixed');
$(forScroll).css('width', '');
if (currentScroll >= ($(forScroll).offset().top - navbarHeight)) {
$(forScroll).addClass('fixed');
$(forScroll).width(forScrollWidth);
if (currentScroll >= ($(forScroll).offset().top - navbarHeight)) {
$(forScroll).addClass('fixed');
$(forScroll).width(forScrollWidth);
}
}
}
......@@ -20,8 +22,10 @@ $(document).ready(function () {
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e){
let forScroll = $('.tab-pane.active .forScroll');
$(forScroll).removeClass('fixed');
$(forScroll).css('width', '');
if (forScroll.length) {
$(forScroll).removeClass('fixed');
$(forScroll).css('width', '');
}
});
});
\ No newline at end of file
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