diff --git a/src/Ajax.php b/src/Ajax.php index e8e2960f9..84856a367 100644 --- a/src/Ajax.php +++ b/src/Ajax.php @@ -176,6 +176,11 @@ class Ajax { $this->response['action'] = $this->action; + // Show ajax action in console log + if (!empty($_COOKIE['explain'])) { + $this->response['console_log'] = 'ajax action: ' . $this->response['action']; + } + if (Dev::sqlDebugAllowed()) { $this->response['sql_log'] = Dev::getSqlLog(); } diff --git a/styles/js/main.js b/styles/js/main.js index 6c6f5489c..a9271fc15 100644 --- a/styles/js/main.js +++ b/styles/js/main.js @@ -343,12 +343,14 @@ Ajax.prototype = { } } else if (response.error_code) { ajax.showErrorMsg(response.error_msg); - console.log(response.console_log); $('.loading-1').removeClass('loading-1').html('error'); } else { ajax.callback[action](response); ajax.clearActionState(action); } + if (response.console_log) { + console.log(response.console_log); + } }, error: function (xml, desc) {