@@ -38,7 +38,9 @@ protected function _ajax($method, $url, $responseElement = "", $parameters = [])
3838 $ retour .= $ before ;
3939 if ($ hasLoader === true && JString::isNotNull ($ responseElement )) {
4040 $ this ->addLoading ($ retour , $ responseElement , $ ajaxLoader );
41- } elseif ($ hasLoader === "internal " ) {
41+ } elseif ($ hasLoader === 'response ' ) {
42+ $ this ->addResponseLoading ($ retour , $ responseElement , $ ajaxLoader );
43+ } elseif ($ hasLoader === 'internal ' ) {
4244 $ retour .= "\n$(this).addClass('loading'); " ;
4345 }
4446 $ ajaxParameters = [
@@ -202,6 +204,14 @@ public static function _implodeParams($parameters) {
202204 }
203205
204206 protected function addLoading (&$ retour , $ responseElement , $ ajaxLoader = null ) {
207+ if (! isset ($ ajaxLoader )) {
208+ $ ajaxLoader = $ this ->ajaxLoader ;
209+ }
210+ $ loading_notifier = '<div class="ajax-loader ui active inverted dimmer"> ' . $ ajaxLoader . '</div> ' ;
211+ $ retour .= "\t\t{$ responseElement }.append(' {$ loading_notifier }'); \n" ;
212+ }
213+
214+ protected function addResponseLoading (&$ retour , $ responseElement , $ ajaxLoader = null ) {
205215 if (! isset ($ ajaxLoader )) {
206216 $ ajaxLoader = $ this ->ajaxLoader ;
207217 }
@@ -729,7 +739,9 @@ private function _postForm($url, $form, $responseElement, $parameters = []) {
729739 $ retour .= $ before ;
730740 if ($ hasLoader === true ) {
731741 $ this ->addLoading ($ retour , $ responseElement , $ ajaxLoader );
732- } elseif ($ hasLoader === "internal " ) {
742+ } elseif ($ hasLoader === 'response ' ) {
743+ $ this ->addResponseLoading ($ retour , $ responseElement , $ ajaxLoader );
744+ } elseif ($ hasLoader === 'internal ' ) {
733745 $ retour .= "\n$(this).addClass('loading'); " ;
734746 }
735747 $ ajaxParameters = [
0 commit comments