X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=www%2Fjssrc%2Fblerg%2FControls.js;h=f386627fbca091fb0c923a017dd62e16ebd819c3;hb=868758a60c47c984eb76bae45183d063981ebdd5;hp=165b1000ffc0fbbe176633b1deae6540be6e5ea4;hpb=2d498144a3a655c1fd4e54b9e9d61d1c3eb82206;p=blerg.git diff --git a/www/jssrc/blerg/Controls.js b/www/jssrc/blerg/Controls.js index 165b100..f386627 100644 --- a/www/jssrc/blerg/Controls.js +++ b/www/jssrc/blerg/Controls.js @@ -10,7 +10,8 @@ enyo.kind({ handlers: { onLogin: "login", onLogout: "logout", - onPostVisibility: "postVisibilityUpdate" + onPostVisibility: "postVisibilityUpdate", + onClearFeedStatus: "clearFeedStatus" }, components: [ {name: "loggedOutControls", components: [ @@ -27,7 +28,7 @@ enyo.kind({ ]} ]}, {name: "loggedInControls", showing: false, components: [ - {name: "greeting", components: [ + {name: "greeting", classes: "blerg-controls-greeting", components: [ {tag: null, content: "Hello, "}, {name: "userlink", tag: "a"}, {tag: null, content: ". "}, @@ -82,9 +83,9 @@ enyo.kind({ 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) { @@ -102,6 +103,9 @@ enyo.kind({ 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) { @@ -117,5 +121,8 @@ enyo.kind({ feedClicked: function() { window.location.href = '/#/feed'; this.bubble('onNavigate'); + }, + clearFeedStatus: function() { + this.gotFeedInfo(this, {new: 0}); } });