onStartSignup: "showSignupDialog",
onTryLogin: "tryLogin",
onTryLogout: "tryLogout",
- onSetTitle: "setTitle"
+ onSetTitle: "setTitle",
+ onPostVisibility: "postVisibilityUpdate"
},
components: [
{classes: "blerg-header", components: [
['hash', /^#\/feed(?:\/p(\d+))?$/, "blerg.Feed"],
['hash', /^#([A-Za-z0-9_-]+)(?:\/(p)?(\d+))?$/, "blerg.User"]
],
- pathHandlers: [ blerg.Welcome ],
+ pathHandlers: [ blerg.User, blerg.Welcome ],
rendered: function() {
this.inherited(arguments);
this.lastHash = location.hash;
this.urlSwitch();
- //setInterval(this.hashCheck.bind(this), 250);
+ setInterval(this.hashCheck.bind(this), 250);
document.body.addEventListener('keyup', function(event) {
if (event.shiftKey && event.keyCode == 32) {
this.$.signupDialog.show();
},
setTitle: function(inSender, inEvent) {
- if (inEvent.section != undefined)
- this.$.title.setSection(inEvent.section);
-
- if (inEvent.subscribed != undefined)
- this.$.title.setSubscribed(inEvent.subscribed);
-
- if (inEvent.showControls)
- this.$.title.showControls()
- else
- this.$.title.hideControls();
+ this.$.title.waterfall('onSetTitle', inEvent);
},
tryLogin: function(inSender, inEvent) {
this.$.api.login(inEvent.username, inEvent.password);
logout: function(inSender, inEvent) {
clearInterval(this.feedStatusUpdateInterval);
this.waterfall('onLogout');
+ },
+ postVisibilityUpdate: function(inSender, inEvent) {
+ this.$.post.waterfall('onPostVisibility', inEvent);
+ this.$.controls.waterfall('onPostVisibility', inEvent);
}
});