Reload user when posting
authorChip Black <bytex64@bytex64.net>
Sat, 26 May 2012 22:06:31 +0000 (15:06 -0700)
committerChip Black <bytex64@bytex64.net>
Sat, 26 May 2012 22:06:31 +0000 (15:06 -0700)
www/jssrc/blerg/Blerg.js
www/jssrc/blerg/Post.js
www/jssrc/blerg/User.js
www/jssrc/lib/blergmedia.js [moved from www/js/blergmedia.js with 100% similarity]

index 45b7d5f..6eac0d8 100644 (file)
@@ -8,7 +8,8 @@ enyo.kind({
         onTryLogin: "tryLogin",
         onTryLogout: "tryLogout",
         onSetTitle: "setTitle",
-        onPostVisibility: "postVisibilityUpdate"
+        onPostVisibility: "postVisibilityUpdate",
+        onReload: "sendReload"
     },
     components: [
         {classes: "blerg-header", components: [
@@ -88,5 +89,8 @@ enyo.kind({
     postVisibilityUpdate: function(inSender, inEvent) {
         this.$.post.waterfall('onPostVisibility', inEvent);
         this.$.controls.waterfall('onPostVisibility', inEvent);
+    },
+    sendReload: function() {
+        this.$.main.waterfall('onReload');
     }
 });
index ee537f2..0c72a99 100644 (file)
@@ -40,7 +40,11 @@ enyo.kind({
     postSuccessful: function() {
         this.setData('');
         this.closePost();
-        this.href = '#' + blerg.API.username;
+        if (location.hash != '#' + blerg.API.username) {
+            qlink(blerg.API.username);
+        } else {
+            this.bubble('onReload');
+        }
     },
     postFailed: function() {
         alert('Could not post!');
index 78f5247..7871051 100644 (file)
@@ -4,7 +4,8 @@ enyo.kind({
     listKind: "blerg.Record",
     handlers: {
         onLogin: "getStalkStatus",
-        onLogout: "getStalkStatus"
+        onLogout: "getStalkStatus",
+        onReload: "usernameChanged"
     },
     published: {
         username: "",