handle_rpc_json: fix netalert button never appearing on JSON parse error
This commit is contained in:
parent
829d478f1b
commit
3188e863b3
|
@ -232,8 +232,7 @@
|
||||||
|
|
||||||
<button id="net-alert" dojoType="dijit.form.Button" style="display : none" disabled="true"
|
<button id="net-alert" dojoType="dijit.form.Button" style="display : none" disabled="true"
|
||||||
title="<?php echo __("Communication problem with server.") ?>">
|
title="<?php echo __("Communication problem with server.") ?>">
|
||||||
<img
|
<img src="images/error.png" />
|
||||||
src="images/error.png" />
|
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div dojoType="dijit.form.DropDownButton">
|
<div dojoType="dijit.form.DropDownButton">
|
||||||
|
|
14
js/tt-rss.js
14
js/tt-rss.js
|
@ -994,14 +994,14 @@ function reverseHeadlineOrder() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle_rpc_json(transport, scheduled_call) {
|
function handle_rpc_json(transport, scheduled_call) {
|
||||||
try {
|
|
||||||
var reply = JSON.parse(transport.responseText);
|
|
||||||
|
|
||||||
var netalert_dijit = dijit.byId("net-alert");
|
var netalert_dijit = dijit.byId("net-alert");
|
||||||
var netalert = false;
|
var netalert = false;
|
||||||
|
|
||||||
if (netalert_dijit)
|
if (netalert_dijit) netalert = netalert_dijit.domNode;
|
||||||
netalert = netalert_dijit.domNode;
|
|
||||||
|
try {
|
||||||
|
var reply = JSON.parse(transport.responseText);
|
||||||
|
|
||||||
if (reply) {
|
if (reply) {
|
||||||
|
|
||||||
|
@ -1049,18 +1049,18 @@ function handle_rpc_json(transport, scheduled_call) {
|
||||||
if (runtime_info)
|
if (runtime_info)
|
||||||
parse_runtime_info(runtime_info);
|
parse_runtime_info(runtime_info);
|
||||||
|
|
||||||
if (netalert) Element.hide(netalert);
|
if (netalert) netalert.hide();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (netalert)
|
if (netalert)
|
||||||
Element.show(netalert);
|
netalert.show();
|
||||||
else
|
else
|
||||||
notify_error("Communication problem with server.");
|
notify_error("Communication problem with server.");
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (netalert)
|
if (netalert)
|
||||||
Element.show(netalert);
|
netalert.show();
|
||||||
else
|
else
|
||||||
notify_error("Communication problem with server.");
|
notify_error("Communication problem with server.");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue