@@ -34,7 +34,7 @@ protected function _ajax($method,$url,$responseElement="",$parameters=[]) {
3434 $ retour =$ this ->_getAjaxUrl ($ url , $ attr );
3535 $ responseElement =$ this ->_getResponseElement ($ responseElement );
3636 $ retour .="var self=this; \n" ;
37- if ($ hasLoader ===true ){
37+ if ($ hasLoader ===true && JString:: isNotNull ( $ responseElement ) ){
3838 $ this ->addLoading ($ retour , $ responseElement );
3939 }
4040
@@ -107,7 +107,7 @@ protected function _getOnAjaxDone($responseElement,$jqueryDone,$ajaxTransition,$
107107 if (\is_callable ($ call ))
108108 $ retour ="\t" .$ call ($ responseElement ,$ jqueryDone )."; \n" ;
109109 else
110- $ retour ="\t$( {$ responseElement }) . {$ jqueryDone }( data ); \n" ;
110+ $ retour ="\t{$ responseElement }. {$ jqueryDone }( data ); \n" ;
111111 }
112112 $ retour .="\t" .$ jsCallback ."\n" ;
113113 return $ retour ;
@@ -116,6 +116,7 @@ protected function _getOnAjaxDone($responseElement,$jqueryDone,$ajaxTransition,$
116116 protected function _getResponseElement ($ responseElement ){
117117 if ($ responseElement !=="" ) {
118118 $ responseElement =Javascript::prep_value ($ responseElement );
119+ $ responseElement =Javascript::prep_jquery_selector ($ responseElement );
119120 }
120121 return $ responseElement ;
121122 }
@@ -156,8 +157,8 @@ protected function addLoading(&$retour, $responseElement) {
156157 $ loading_notifier .=$ this ->ajaxLoader ;
157158 }
158159 $ loading_notifier .='</div> ' ;
159- $ retour .="$( {$ responseElement }) .empty(); \n" ;
160- $ retour .="\t\t$( {$ responseElement }) .prepend(' {$ loading_notifier }'); \n" ;
160+ $ retour .="{$ responseElement }.empty(); \n" ;
161+ $ retour .="\t\t{$ responseElement }.prepend(' {$ loading_notifier }'); \n" ;
161162 }
162163
163164 protected function setAjaxDataCall ($ params ){
0 commit comments