1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 01:25:56 +00:00

minor cleanup related to toolbar-main (use dijit methods, etc)

This commit is contained in:
Andrew Dolgov
2021-03-08 10:43:49 +03:00
parent 5db6939dc9
commit 1fb7125f90
4 changed files with 23 additions and 35 deletions

View File

@@ -117,15 +117,21 @@ const Feeds = {
},
reloadCurrent: function(method) {
if (this.getActive() != undefined) {
console.log("reloadCurrent: " + method);
console.log("reloadCurrent", this.getActive(), this.activeIsCat(), method);
this.open({feed: this.getActive(), is_cat: this.activeIsCat(), method: method});
}
return false; // block unneeded form submits
},
openDefaultFeed: function() {
this.open({feed: this._default_feed_id});
},
onViewModeChanged: function() {
// TODO: is this still needed?
App.find("body").setAttribute("view-mode",
dijit.byId("toolbar-main").getValues().view_mode);
return Feeds.reloadCurrent('');
},
openNextUnread: function() {
const is_cat = this.activeIsCat();
const nuf = this.getNextUnread(this.getActive(), is_cat);
@@ -369,10 +375,7 @@ const Feeds = {
}, 10 * 1000);
}
//Form.enable("toolbar-main");
let query = Object.assign({op: "feeds", method: "view", feed: feed},
dojo.formToObject("toolbar-main"));
let query = {...{op: "feeds", method: "view", feed: feed}, ...dojo.formToObject("toolbar-main")};
if (method) query.m = method;