Commit 9e68e6f7 authored by Eric Seigne's avatar Eric Seigne
Browse files

fix #332 : retour sur historique

parent ab4c742a
......@@ -90,6 +90,19 @@ function gotoPage(destination, saveHistory = true) {
}
if (globalMyNavigator !== undefined) {
let changeIsDone = false;
//Cas particulier des détails de ndf -> retour sur historique
if (globalCurrentPage == "details.html" && destination == "historique.html") {
myDebug("gotoPage : cas particulier details ->historique ");
globalMyNavigator.popPage();
changeIsDone = true;
}
if (globalCurrentPage == "detailsLdf.html" && destination == "historique.html") {
myDebug("gotoPage : cas particulier details ->historique ");
globalMyNavigator.popPage();
changeIsDone = true;
}
globalCurrentPage = destination;
myDebug("gotoPage : on change globalCurrentPage pour avoir maintenant : " + globalCurrentPage);
//Si on arrive sur le menu on zappe toutes les autres pages possibles de la stack
......@@ -97,7 +110,9 @@ function gotoPage(destination, saveHistory = true) {
globalMyNavigator.resetToPage(destination, { data: { title: 'avenir', name: destination } });
}
else {
globalMyNavigator.pushPage(destination, { data: { title: 'avenir', name: destination } });
if (!changeIsDone) {
globalMyNavigator.pushPage(destination, { data: { title: 'avenir', name: destination } });
}
}
}
......
......@@ -726,7 +726,7 @@ document.addEventListener('init', function (event) {
if (data.ttc > 0) {
texte += " (" + nbFR(data.ttc) + ")";
}
var loadthis = "<ons-list-item modifier=\"longdivider\" tappable onclick=\"localStoreData('ldfId','" + data.sid + "');gotoPage('detailsLdf.html', true);\"><div class=\"left\">" + icone + "</div><div class=\"center\">" + texte + "</div></ons-list-item>";
var loadthis = "<ons-list-item modifier=\"longdivider\" tappable onclick=\"localStoreData('ldfId','" + data.sid + "');gotoPage('detailsLdf.html');\"><div class=\"left\">" + icone + "</div><div class=\"center\">" + texte + "</div></ons-list-item>";
$(loadthis).hide().appendTo($('#contenuNDFS')).fadeIn(1000);
}
hideWait();
......@@ -873,7 +873,7 @@ document.addEventListener('init', function (event) {
montantTxt = " (" + data.montant + " €)";
}
}
var loadthis = "<ons-button modifier=\"material large\" onclick=\"localStoreData('ndfId','" + data.sid + "'); localStoreData('ndfStatus','" + data.status + "');localStoreData('ndfLabel','" + data.label + "');gotoPage('details.html', true);\" class=\"menubutton\"" + styleTxt + "><i class=\"fas fa-angle-right\"></i> " + data.label + montantTxt + "</ons-button>";
var loadthis = "<ons-button modifier=\"material large\" onclick=\"localStoreData('ndfId','" + data.sid + "'); localStoreData('ndfStatus','" + data.status + "');localStoreData('ndfLabel','" + data.label + "');gotoPage('details.html');\" class=\"menubutton\"" + styleTxt + "><i class=\"fas fa-angle-right\"></i> " + data.label + montantTxt + "</ons-button>";
//var loadthis = "<p>" + data.label + " (" + data.montant + " €) <a href=\"#\" onclick=\">[détails]</a></p>";
$(loadthis).hide().appendTo($('#contenuNDF')).fadeIn(1000);
......
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