diff options
author | Art4 <[email protected]> | 2015-02-19 23:17:43 +0100 |
---|---|---|
committer | Art4 <[email protected]> | 2015-02-19 23:17:43 +0100 |
commit | d9c042c4c536f1afbf206aeea09b0b127b7b6418 (patch) | |
tree | 9d7ef18c6d9d4c8f8f4d1c9a5dbfceeb9fd5acf4 /js/tt-rss.js | |
parent | cf42b79120290ee5866136a0c4656e6999f06045 (diff) | |
parent | 4ca621a36016de1fbb5447e1c1de0b607ba94a7c (diff) |
Merge branch 'master' into patch-1
Conflicts:
locale/de_DE/LC_MESSAGES/messages.po
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); |