X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=www%2Fjssrc%2Fblerg%2FBlerg.js;h=52de4e3ce2b16fb6022c06c0c331af99570001d6;hb=65a1f7dc82554486ffa9cc03eac29a7a1642f046;hp=2a571a82a23c252e1d3d6c702595f060d00304b8;hpb=be0647e6531fec4b4b50a1a0c0d4e826e5e6f16b;p=blerg.git diff --git a/www/jssrc/blerg/Blerg.js b/www/jssrc/blerg/Blerg.js index 2a571a8..52de4e3 100644 --- a/www/jssrc/blerg/Blerg.js +++ b/www/jssrc/blerg/Blerg.js @@ -6,7 +6,8 @@ enyo.kind({ onStartSignup: "showSignupDialog", onTryLogin: "tryLogin", onTryLogout: "tryLogout", - onSetTitle: "setTitle" + onSetTitle: "setTitle", + onPostVisibility: "postVisibilityUpdate" }, components: [ {classes: "blerg-header", components: [ @@ -30,14 +31,14 @@ enyo.kind({ ['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) { @@ -71,16 +72,7 @@ enyo.kind({ 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); @@ -102,5 +94,9 @@ enyo.kind({ logout: function(inSender, inEvent) { clearInterval(this.feedStatusUpdateInterval); this.waterfall('onLogout'); + }, + postVisibilityUpdate: function(inSender, inEvent) { + this.$.post.waterfall('onPostVisibility', inEvent); + this.$.controls.waterfall('onPostVisibility', inEvent); } });