commit:6eee0074c07ce85359975621ff832943d320493a
author:Chip Black
committer:Chip Black
date:Wed Jun 6 13:51:21 2012 -0700
parents:2d498144a3a655c1fd4e54b9e9d61d1c3eb82206
Clear feed status when reading feed
diff --git a/www/jssrc/blerg/Blerg.js b/www/jssrc/blerg/Blerg.js
line changes: +4/-0
index 9285d2b..827dc06
--- a/www/jssrc/blerg/Blerg.js
+++ b/www/jssrc/blerg/Blerg.js
@@ -11,6 +11,7 @@ enyo.kind({
         onPostVisibility: "postVisibilityUpdate",
         onReload: "sendReload",
         onShowChangePassword: "showChangePassword",
+        onClearFeedStatus: "clearFeedStatus"
     },
     components: [
         {classes: "blerg-header", components: [
@@ -96,5 +97,8 @@ enyo.kind({
     },
     showChangePassword: function() {
         this.$.passwdDialog.show();
+    },
+    clearFeedStatus: function() {
+        this.$.controls.waterfall('onClearFeedStatus');
     }
 });

diff --git a/www/jssrc/blerg/Controls.js b/www/jssrc/blerg/Controls.js
line changes: +10/-3
index 165b100..529df1e
--- 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: [
@@ -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});
     }
 });

diff --git a/www/jssrc/blerg/Feed.js b/www/jssrc/blerg/Feed.js
line changes: +1/-0
index 63ef7fb..a07d7e5
--- a/www/jssrc/blerg/Feed.js
+++ b/www/jssrc/blerg/Feed.js
@@ -28,5 +28,6 @@ enyo.kind({
     },
     itemsLoaded: function(inSender, inEvent) {
         this.addItems(inEvent.entries);
+        this.bubble('onClearFeedStatus');
     }
 });