X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=www%2Fjssrc%2Fblerg%2FTitle.js;h=17d62a218bd096858c4f5f3d57d0debdf700a119;hb=1a21466c7e3f8c18c4c35df56c270546ae8e6434;hp=8fa9dbca6af6b1b66cc2ac074f58ded2e0172e5a;hpb=21db04ef3e4f66d7b5c4c9be2be36703b18cbcaa;p=blerg.git diff --git a/www/jssrc/blerg/Title.js b/www/jssrc/blerg/Title.js index 8fa9dbc..17d62a2 100644 --- a/www/jssrc/blerg/Title.js +++ b/www/jssrc/blerg/Title.js @@ -1,57 +1,30 @@ enyo.kind({ - name: "blerg.Title", - kind: "Control", - style: "float: left; width: 40%", - published: { - subscribed: null, - section: "" - }, - components: [ - {kind: "Image", classes: "logo", src: "images/blerglogo.png", attributes: {width: 125, height: 122}}, - {tag: "h1", components: [ - {kind: "blerg.Link", 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(); - } + name: "blerg.Title", + kind: "Control", + classes: "blerg-title", + published: { + section: "" + }, + handlers: { + onSetTitle: "setTitle" + }, + components: [ + {kind: "Image", classes: "logo", src: "images/blerglogo.png", attributes: {width: 125, height: 122}}, + {tag: "h1", components: [ + {kind: "blerg.Link", href: "/#/", content: "Blërg!"} + ]}, + {tag: "h2", components: [ + {name: "section", tag: "span"} + ]} + ], + create: function() { + this.inherited(arguments); + }, + sectionChanged: function() { + this.$.section.setContent(this.section); + }, + setTitle: function(inSender, inEvent) { + if (inEvent.section) + this.setSection(inEvent.section); + } });