@@ -114,7 +114,9 @@ protected function _getOnAjaxDone($responseElement,$jqueryDone,$ajaxTransition,$
114114 $ retour ="\t{$ responseElement }. {$ jqueryDone }( data ); \n" ;
115115 }
116116 if (isset ($ history )){
117- $ retour .="\nwindow.history.pushState({'html':data,'selector': " .Javascript::prep_value ($ history ).",'jqueryDone':' {$ jqueryDone }'},'', url); " ;
117+ $ retour .="\nfunction getHref(url) { return \$('a').filter(function(){return \$(this).prop('href') == url; });} " ;
118+ $ retour .="\nif(window._previousURL) getHref(window._previousURL).removeClass('active');getHref(url).addClass('active'); " ;
119+ $ retour .="\nwindow.history.pushState({'html':data,'selector': " .Javascript::prep_value ($ history ).",'jqueryDone':' {$ jqueryDone }'},'', url);window._previousURL=url; " ;
118120 }
119121 if ($ hasLoader ==="internal " ){
120122 $ retour .="\n$(self).removeClass('loading'); " ;
@@ -125,7 +127,6 @@ protected function _getOnAjaxDone($responseElement,$jqueryDone,$ajaxTransition,$
125127
126128 protected function _getResponseElement ($ responseElement ){
127129 if (JString::isNotNull ($ responseElement )) {
128- $ responseElement =Javascript::prep_value ($ responseElement );
129130 $ responseElement =Javascript::prep_jquery_selector ($ responseElement );
130131 }
131132 return $ responseElement ;
@@ -424,7 +425,7 @@ public function getOnClick($element, $url, $responseElement="", $parameters=arra
424425 public function getHref ($ element ,$ responseElement ="" ,$ parameters =array ()){
425426 $ parameters ["attr " ]="href " ;
426427 if (JString::isNull ($ responseElement )){
427- $ responseElement ='$($(this ).attr("data-target")) ' ;
428+ $ responseElement ='%$(self ).attr("data-target")% ' ;
428429 }
429430 if (!isset ($ parameters ["historize " ])){
430431 $ parameters ["historize " ]=true ;
@@ -442,7 +443,7 @@ public function getHref($element,$responseElement="",$parameters=array()){
442443 public function postHref ($ element ,$ responseElement ="" ,$ parameters =array ()){
443444 $ parameters ["attr " ]="href " ;
444445 if (JString::isNull ($ responseElement )){
445- $ responseElement ='$($( this).attr("data-target")) ' ;
446+ $ responseElement ='%$( this).attr("data-target")% ' ;
446447 }
447448 if (!isset ($ parameters ["historize " ])){
448449 $ parameters ["historize " ]=true ;
0 commit comments