diff options
Diffstat (limited to 'js/tt-rss.js')
-rw-r--r-- | js/tt-rss.js | 66 |
1 files changed, 26 insertions, 40 deletions
diff --git a/js/tt-rss.js b/js/tt-rss.js index c64145159..e79f47176 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -302,21 +302,27 @@ function init() { hotkey_actions["collapse_article"] = function() { var id = getActiveArticleId(); var elem = $("CICD-"+id); - if(elem.visible()) { - cdmCollapseArticle(null, id); - } - else { - cdmExpandArticle(id); + + if (elem) { + if (elem.visible()) { + cdmCollapseArticle(null, id); + } + else { + cdmExpandArticle(id); + } } }; hotkey_actions["toggle_expand"] = function() { var id = getActiveArticleId(); var elem = $("CICD-"+id); - if(elem.visible()) { - cdmCollapseArticle(null, id, false); - } - else { - cdmExpandArticle(id); + + if (elem) { + if (elem.visible()) { + cdmCollapseArticle(null, id, false); + } + else { + cdmExpandArticle(id); + } } }; hotkey_actions["search_dialog"] = function() { @@ -750,15 +756,6 @@ function parse_runtime_info(data) { // console.log("RI: " + k + " => " + v); - if (k == "new_version_available") { - if (v == "1") { - Element.show(dijit.byId("newVersionIcon").domNode); - } else { - Element.hide(dijit.byId("newVersionIcon").domNode); - } - return; - } - if (k == "dep_ts" && parseInt(getInitParam("dep_ts")) > 0) { if (parseInt(getInitParam("dep_ts")) < parseInt(v) && getInitParam("reload_on_ts_change")) { window.location.reload(); @@ -770,6 +767,16 @@ function parse_runtime_info(data) { return; } + if (k == "update_result") { + var updatesIcon = dijit.byId("updatesIcon").domNode; + + if (v) { + Element.show(updatesIcon); + } else { + Element.hide(updatesIcon); + } + } + if (k == "daemon_stamp_ok" && v != 1) { notify_error("<span onclick=\"javascript:explainError(3)\">Update daemon is not updating feeds.</span>", true); return; @@ -962,27 +969,6 @@ function reverseHeadlineOrder() { } } -function newVersionDlg() { - try { - var query = "backend.php?op=dlg&method=newVersion"; - - if (dijit.byId("newVersionDlg")) - dijit.byId("newVersionDlg").destroyRecursive(); - - dialog = new dijit.Dialog({ - id: "newVersionDlg", - title: __("New version available!"), - style: "width: 600px", - href: query, - }); - - dialog.show(); - - } catch (e) { - exception_error("newVersionDlg", e); - } -} - function handle_rpc_json(transport, scheduled_call) { try { var reply = JSON.parse(transport.responseText); |