restore feed from URL hash after feedlist init

master
Andrew Dolgov 6 years ago
parent 6479c07324
commit 9368f1a07f

@ -203,10 +203,13 @@ define(["dojo/_base/declare"], function (declare) {
document.onkeypress = (event) => { return App.hotkeyHandler(event) }; document.onkeypress = (event) => { return App.hotkeyHandler(event) };
window.onresize = () => { Headlines.scrollHandler(); } window.onresize = () => { Headlines.scrollHandler(); }
if (!this.getActive()) { const hash_feed_id = hash_get('f');
this.open({feed: -3}); const hash_feed_is_cat = hash_get('c') == "1";
if (hash_feed_id != undefined) {
this.open({feed: hash_feed_id, is_cat: hash_feed_is_cat});
} else { } else {
this.open({feed: this.getActive(), is_cat: this.activeIsCat()}); this.open({feed: -3});
} }
this.hideOrShowFeeds(App.getInitParam("hide_read_feeds") == 1); this.hideOrShowFeeds(App.getInitParam("hide_read_feeds") == 1);
@ -250,6 +253,8 @@ define(["dojo/_base/declare"], function (declare) {
return this._active_feed_id; return this._active_feed_id;
}, },
setActive: function(id, is_cat) { setActive: function(id, is_cat) {
console.log('setActive', id, is_cat);
hash_set('f', id); hash_set('f', id);
hash_set('c', is_cat ? 1 : 0); hash_set('c', is_cat ? 1 : 0);

@ -148,13 +148,6 @@ require(["dojo/_base/kernel",
dijit.getEnclosingWidget(toolbar.order_by).attr('value', dijit.getEnclosingWidget(toolbar.order_by).attr('value',
App.getInitParam("default_view_order_by")); App.getInitParam("default_view_order_by"));
const hash_feed_id = hash_get('f');
const hash_feed_is_cat = hash_get('c') == "1";
if (hash_feed_id != undefined) {
Feeds.setActive(hash_feed_id, hash_feed_is_cat);
}
App.setLoadingProgress(50); App.setLoadingProgress(50);
this._widescreen_mode = App.getInitParam("widescreen"); this._widescreen_mode = App.getInitParam("widescreen");

Loading…
Cancel
Save