X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=www%2Fjssrc%2Fblerg%2FTitle.js;h=bd82520105d709b18f0dbb0cb902df6e563200d7;hb=55431b133192e59138a51591d7ef4ef20b6ceb52;hp=8fa9dbca6af6b1b66cc2ac074f58ded2e0172e5a;hpb=be0647e6531fec4b4b50a1a0c0d4e826e5e6f16b;p=blerg.git diff --git a/www/jssrc/blerg/Title.js b/www/jssrc/blerg/Title.js index 8fa9dbc..bd82520 100644 --- a/www/jssrc/blerg/Title.js +++ b/www/jssrc/blerg/Title.js @@ -3,55 +3,28 @@ enyo.kind({ kind: "Control", style: "float: left; width: 40%", published: { - subscribed: null, section: "" }, + handlers: { + onSetTitle: "setTitle" + }, components: [ {kind: "Image", classes: "logo", src: "images/blerglogo.png", attributes: {width: 125, height: 122}}, {tag: "h1", components: [ - {kind: "blerg.Link", content: "Blërg!"} + {kind: "blerg.Link", href: "#/", content: "Blërg!"} ]}, {tag: "h2", components: [ {name: "section", tag: "span"} - ]}, - {name: "userControls", showing: false, components: [ - {kind: "blerg.Link", onclick: "clickChatter", content: "[chatter]"}, - {name: "subscribeLink", kind: "blerg.Link", onclick: "clickSubscribe", showing: false, content: "[stalk]"}, - {name: "unsubscribeLink", kind: "blerg.Link", onclick: "clickUnsubscribe", showing: false, content: "[stop stalking]"} ]} ], create: function() { this.inherited(arguments); - this.subscribedChanged(); - }, - clickChatter: function() { - this.bubble("onChatter"); - }, - clickSubscribe: function() { - this.bubble("onSubscribe"); - }, - clickUnsubscribe: function() { - this.bubble("onUnsubscribe"); - }, - subscribedChanged: function() { - if (this.subscribed == null) { - this.$.subscribeLink.hide(); - this.$.unsubscribeLink.hide(); - } else if (this.subscribed) { - this.$.subscribeLink.hide(); - this.$.unsubscribeLink.show(); - } else { - this.$.subscribeLink.show(); - this.$.unsubscribeLink.hide(); - } }, sectionChanged: function() { this.$.section.setContent(this.section); }, - showControls: function() { - this.$.userControls.hide(); - }, - hideControls: function() { - this.$.userControls.hide(); + setTitle: function(inSender, inEvent) { + if (inEvent.section) + this.setSection(inEvent.section); } });