Commit 2fef7bcd authored by Mat's avatar Mat

résouds le bug d'affichage du jQRangeSlider

parent 51e14802
...@@ -212,7 +212,10 @@ function displayEditLettre(jsonRow) ...@@ -212,7 +212,10 @@ function displayEditLettre(jsonRow)
form.querySelector('#lettre_startedAt').value = formatDateISO(json.started_at); form.querySelector('#lettre_startedAt').value = formatDateISO(json.started_at);
form.querySelector('#lettre_endedAt').value = formatDateISO(json.ended_at); form.querySelector('#lettre_endedAt').value = formatDateISO(json.ended_at);
initDateRangeSlider(json.started_at, json.ended_at);
$('.form-lettre-modal').on('shown.bs.modal', function (e) {
initDateRangeSlider(json.started_at, json.ended_at);
});
form.querySelector('#lettre_groupe').value = json.groupe.id; form.querySelector('#lettre_groupe').value = json.groupe.id;
form.querySelector('#lettre_offre').value = json.offre.id; form.querySelector('#lettre_offre').value = json.offre.id;
...@@ -309,7 +312,9 @@ reloadTables(); ...@@ -309,7 +312,9 @@ reloadTables();
reloadButton(function(){ reloadTables(); }); reloadButton(function(){ reloadTables(); });
createButton(function(){ createButton(function()
{
titleForm.textContent = 'Nouvelle infolettre'; titleForm.textContent = 'Nouvelle infolettre';
form.querySelector('#lettre_subject').value = null; form.querySelector('#lettre_subject').value = null;
...@@ -318,7 +323,9 @@ createButton(function(){ ...@@ -318,7 +323,9 @@ createButton(function(){
//$("#dateRuleSlider").dateRangeSlider("destroy"); //$("#dateRuleSlider").dateRangeSlider("destroy");
initDateRangeSlider(new Date(), proposeEndDay()); $('.form-lettre-modal').on('shown.bs.modal', function (e) {
initDateRangeSlider(new Date(), proposeEndDay());
});
form.querySelector('#lettre_groupe').value = null; form.querySelector('#lettre_groupe').value = null;
form.querySelector('#lettre_offre').value = null; form.querySelector('#lettre_offre').value = null;
......
...@@ -27,8 +27,6 @@ function firstJump(current, dow) { ...@@ -27,8 +27,6 @@ function firstJump(current, dow) {
function initDateRangeSlider(minDate, maxDate) function initDateRangeSlider(minDate, maxDate)
{ {
// $('.modal').load(function(){
// });
let months = ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"]; let months = ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"];
let dows = ['di', 'lu', 'ma', 'me', 'je', 've', 'sa']; let dows = ['di', 'lu', 'ma', 'me', 'je', 've', 'sa'];
......
...@@ -153,7 +153,10 @@ function editBlocLettre() ...@@ -153,7 +153,10 @@ function editBlocLettre()
form.querySelector('#lettre_startedAt').value = formatDateISO(json.started_at); form.querySelector('#lettre_startedAt').value = formatDateISO(json.started_at);
form.querySelector('#lettre_endedAt').value = formatDateISO(json.ended_at); form.querySelector('#lettre_endedAt').value = formatDateISO(json.ended_at);
initDateRangeSlider(json.started_at, json.ended_at);
$('.form-lettre-modal').on('shown.bs.modal', function (e) {
initDateRangeSlider(json.started_at, json.ended_at);
});
form.querySelector('#lettre_status').value = json.status; form.querySelector('#lettre_status').value = json.status;
submitURL = Routing.generate('api_lettre_update', {'id': id_lettre}); submitURL = Routing.generate('api_lettre_update', {'id': id_lettre});
......
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