Clear feed status when reading feed
onPostVisibility: "postVisibilityUpdate",
onReload: "sendReload",
onShowChangePassword: "showChangePassword",
+ onClearFeedStatus: "clearFeedStatus"
},
components: [
{classes: "blerg-header", components: [
},
showChangePassword: function() {
this.$.passwdDialog.show();
+ },
+ clearFeedStatus: function() {
+ this.$.controls.waterfall('onClearFeedStatus');
}
});
handlers: {
onLogin: "login",
onLogout: "logout",
- onPostVisibility: "postVisibilityUpdate"
+ onPostVisibility: "postVisibilityUpdate",
+ onClearFeedStatus: "clearFeedStatus"
},
components: [
{name: "loggedOutControls", components: [
this.$.userlink.setContent('@' + inEvent.username);
this.username = inEvent.username;
- this.$.api.getFeedInfo();
+ this.updateFeedInfo();
this.feedStatusUpdateInterval = setInterval(function() {
- this.$.api.getFeedInfo();
+ this.updateFeedInfo();
}.bind(this), 900000);
},
logout: function(inSender, inEvent) {
this.postShowing = inEvent.showing;
this.$.spewButton.addRemoveClass('active', inEvent.showing);
},
+ updateFeedInfo: function() {
+ this.$.api.getFeedInfo();
+ },
gotFeedInfo: function(inSender, inEvent) {
this.$.feedButton.addRemoveClass('new', inEvent.new > 0);
if (inEvent.new > 0) {
feedClicked: function() {
window.location.href = '/#/feed';
this.bubble('onNavigate');
+ },
+ clearFeedStatus: function() {
+ this.gotFeedInfo(this, {new: 0});
}
});
},
itemsLoaded: function(inSender, inEvent) {
this.addItems(inEvent.entries);
+ this.bubble('onClearFeedStatus');
}
});