X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=js%2Ftt-rss.js;h=a66411d11d507f0e123d942756088e5e3b32789c;hb=3263c9ccee799969a4a4322cd359553bb54b76ce;hp=04aec0cca01fa284a42e9a30df2d9654dfbeab4c;hpb=1966e05457ebb537f2bfd11d779cada2489bcf35;p=tt-rss.git diff --git a/js/tt-rss.js b/js/tt-rss.js index 04aec0cc..a66411d1 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -550,9 +550,6 @@ function init_second_stage() { updateFeedList(); closeArticlePanel(); - _widescreen_mode = getInitParam("widescreen"); - switchPanelMode(_widescreen_mode); - if (parseInt(getCookie("ttrss_fh_width")) > 0) { dijit.byId("feeds-holder").domNode.setStyle( {width: getCookie("ttrss_fh_width") + "px" }); @@ -624,6 +621,9 @@ function init_second_stage() { hotkeys[1] = tmp; setInitParam("hotkeys", hotkeys); + _widescreen_mode = getInitParam("widescreen"); + switchPanelMode(_widescreen_mode); + console.log("second stage ok"); if (getInitParam("simple_update")) { @@ -989,6 +989,12 @@ function handle_rpc_json(transport, scheduled_call) { try { var reply = JSON.parse(transport.responseText); + var netalert_dijit = dijit.byId("net-alert"); + var netalert = false; + + if (netalert_dijit) + netalert = netalert_dijit.domNode; + if (reply) { var error = reply['error']; @@ -1035,16 +1041,21 @@ function handle_rpc_json(transport, scheduled_call) { if (runtime_info) parse_runtime_info(runtime_info); - Element.hide(dijit.byId("net-alert").domNode); + if (netalert) Element.hide(netalert); } else { - //notify_error("Error communicating with server."); - Element.show(dijit.byId("net-alert").domNode); + if (netalert) + Element.show(netalert); + else + notify_error("Communication problem with server."); } } catch (e) { - Element.show(dijit.byId("net-alert").domNode); - //notify_error("Error communicating with server."); + if (netalert) + Element.show(netalert); + else + notify_error("Communication problem with server."); + console.log(e); //exception_error("handle_rpc_json", e, transport); } @@ -1064,11 +1075,8 @@ function switchPanelMode(wide) { dijit.byId("content-insert").domNode.setStyle({width: '50%', height: 'auto', - borderLeftWidth: '1px', - borderLeftColor: '#c0c0c0', borderTopWidth: '0px' }); - $("headlines-toolbar").setStyle({ borderBottomWidth: '0px' }); $("headlines-frame").setStyle({ borderBottomWidth: '0px' }); $("headlines-frame").addClassName("wide"); @@ -1078,10 +1086,7 @@ function switchPanelMode(wide) { dijit.byId("content-insert").domNode.setStyle({width: 'auto', height: '50%', - borderLeftWidth: '0px', - borderTopWidth: '1px'}); - - $("headlines-toolbar").setStyle({ borderBottomWidth: '1px' }); + borderTopWidth: '0px'}); $("headlines-frame").setStyle({ borderBottomWidth: '1px' }); $("headlines-frame").removeClassName("wide");