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);
}
});