prefs: move external filter tree onload method (which checks for inactive feeds, etc.) to FilterTree class

This commit is contained in:
Andrew Dolgov 2022-06-05 11:45:13 +03:00
parent fc84712135
commit dd983e5de1
2 changed files with 10 additions and 4 deletions

View File

@ -983,10 +983,6 @@ class Pref_Feeds extends Handler_Protected {
dijit.byId('feedTree').editCategory(bare_id, item);
}
</script>
<script type="dojo/method" event="onLoad" args="item">
dijit.byId('feedTree').checkInactiveFeeds();
dijit.byId('feedTree').checkErrorFeeds();
</script>
</div>
</div>
</div>

View File

@ -5,6 +5,16 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_b
function (declare, domConstruct, checkBoxTree, array, cookie) {
return declare("fox.PrefFeedTree", lib.CheckBoxTree, {
postCreate: function() {
this.inherited(arguments);
const tmph = dojo.connect(this, 'onLoad', () => {
dojo.disconnect(tmph);
this.checkInactiveFeeds();
this.checkErrorFeeds();
});
},
// save state in localStorage instead of cookies
// reference: https://stackoverflow.com/a/27968996
_saveExpandedNodes: function(){