From 3ab4712093ad45c4c4dc90bf0f4e26bf46b4f2c8 Mon Sep 17 00:00:00 2001 From: Cerdic <cedric@yterium.com> Date: Tue, 5 Jun 2012 15:33:15 +0000 Subject: [PATCH] =?UTF-8?q?Report=20de=20r19502=20forcer=20le=20reload=20s?= =?UTF-8?q?i=20redirection=20demandee=20par=20form=20ajax=20:=20si=20url?= =?UTF-8?q?=20differente=20c'est=20ignor=C3=A9,=20mais=20si=20seul=20l'anc?= =?UTF-8?q?re=20change,=20=C3=A7a=20force=20la=20mise=20a=20jour=20de=20la?= =?UTF-8?q?=20pag=20et=20r19525=20Ne=20forcer=20un=20reload=20que=20si=20c?= =?UTF-8?q?'est=20un=20changement=20d'ancre=20simple=20(sinon=20le=20reloa?= =?UTF-8?q?d=20se=20declenche=20parfois=20plus=20vite=20que=20le=20redirec?= =?UTF-8?q?t=20et=20=C3=A7a=20provoque=20un=20comportement=20indesirable)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prive/javascript/ajaxCallback.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/prive/javascript/ajaxCallback.js b/prive/javascript/ajaxCallback.js index 0b418816bf..26418a32c7 100644 --- a/prive/javascript/ajaxCallback.js +++ b/prive/javascript/ajaxCallback.js @@ -244,7 +244,12 @@ jQuery.fn.formulaire_dyn_ajax = function(target) { if (a.length && a.is('a[name=ajax_redirect]')){ a = a.attr('href'); setTimeout(function(){ + var cur = window.location.href.split('#'); document.location.replace(a); + // regarder si c'est juste un changement d'ancre : dans ce cas il faut reload + // (le faire systematiquement provoque des bugs) + if (cur[0]==a.split('#')[0]) + window.location.reload(); },10); // ne pas arreter l'etat loading, puisqu'on redirige ! // mais le relancer car l'image loading a pu disparaitre -- GitLab