Commit 8d4cb0d9 authored by Ivan Tyagov's avatar Ivan Tyagov

Show server side error message in top tabs instead of "undefined" Javascript variable's value.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32780 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 89eaa623
......@@ -57,6 +57,18 @@ function replaceContent(req) {\n
addOnClickEventsToTabs(req);\n
}\n
\n
function showServerSideError(req) {\n
if (loading_deferred) {\n
loading_deferred.cancel();\n
loading_deferred = undefined;\n
}\n
\n
var container = $(\'container\');\n
container.innerHTML = \'Server side error.\';\n
\n
addOnClickEventsToTabs(req);\n
}\n
\n
function showLoadingMessage() {\n
var container = $(\'container\');\n
container.innerHTML = \'<div><p style="text-align: left; vertical-align: middle; font-size: large;">Loading...</p></div>\';\n
......@@ -90,7 +102,7 @@ function selectTab(e) {\n
\n
var url = mapping[this.parentNode.id];\n
var d = doSimpleXMLHttpRequest(url);\n
d.addBoth(replaceContent)\n
d.addCallbacks(replaceContent, showServerSideError);\n
e.stop();\n
\n
loading_deferred = callLater(0.3, showLoadingMessage);\n
......
897
\ No newline at end of file
898
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment