Commit 3188e863 authored by Andrew Dolgov's avatar Andrew Dolgov

handle_rpc_json: fix netalert button never appearing on JSON parse error

parent 829d478f
......@@ -232,8 +232,7 @@
<button id="net-alert" dojoType="dijit.form.Button" style="display : none" disabled="true"
title="<?php echo __("Communication problem with server.") ?>">
<img
src="images/error.png" />
<img src="images/error.png" />
</button>
<div dojoType="dijit.form.DropDownButton">
......
......@@ -994,14 +994,14 @@ function reverseHeadlineOrder() {
}
function handle_rpc_json(transport, scheduled_call) {
try {
var reply = JSON.parse(transport.responseText);
var netalert_dijit = dijit.byId("net-alert");
var netalert = false;
var netalert_dijit = dijit.byId("net-alert");
var netalert = false;
if (netalert_dijit) netalert = netalert_dijit.domNode;
if (netalert_dijit)
netalert = netalert_dijit.domNode;
try {
var reply = JSON.parse(transport.responseText);
if (reply) {
......@@ -1049,18 +1049,18 @@ function handle_rpc_json(transport, scheduled_call) {
if (runtime_info)
parse_runtime_info(runtime_info);
if (netalert) Element.hide(netalert);
if (netalert) netalert.hide();
} else {
if (netalert)
Element.show(netalert);
netalert.show();
else
notify_error("Communication problem with server.");
}
} catch (e) {
if (netalert)
Element.show(netalert);
netalert.show();
else
notify_error("Communication problem with server.");
......
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