]> git.wh0rd.org Git - tt-rss.git/commitdiff
only use hash feed/cat parameters on startup
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 28 Feb 2013 11:56:22 +0000 (15:56 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 28 Feb 2013 11:56:22 +0000 (15:56 +0400)
js/tt-rss.js

index 9814718f09aeef03857beb0de98322ea9032fceb..eb0ec664dc2ab12264d96d6b7fc6158e5791e0f8 100644 (file)
@@ -3,6 +3,8 @@ var hotkey_prefix = false;
 var hotkey_prefix_pressed = false;
 var _widescreen_mode = false;
 var _rpc_seq = 0;
+var _active_feed_id = 0;
+var _active_feed_is_cat = false;
 
 function next_seq() {
        _rpc_seq += 1;
@@ -14,12 +16,12 @@ function get_seq() {
 }
 
 function activeFeedIsCat() {
-       return hash_get('c') == "1";
+       return _active_feed_is_cat;
 }
 
 function getActiveFeedId() {
        try {
-               return hash_get('f');
+               return _active_feed_id;
        } catch (e) {
                exception_error("getActiveFeedId", e);
        }
@@ -30,6 +32,9 @@ function setActiveFeedId(id, is_cat) {
                hash_set('f', id);
                hash_set('c', is_cat ? 1 : 0);
 
+               _active_feed_id = id;
+               _active_feed_is_cat = is_cat;
+
                selectFeed(id, is_cat);
        } catch (e) {
                exception_error("setActiveFeedId", e);
@@ -95,6 +100,13 @@ function updateFeedList() {
                dojo.disconnect(tmph);
                        Element.hide("feedlistLoading");
 
+                       var hash_feed_id = hash_get('f');
+                       var hash_feed_is_cat = hash_get('c') == "1";
+
+                       if (hash_feed_id != undefined) {
+                               setActiveFeedId(hash_feed_id, hash_feed_is_cat);
+                       }
+
                        feedlist_init();
 
 //                     var node = dijit.byId("feedTree")._itemNodesMap['FEED:-2'][0].domNode