Created
June 28, 2013 18:38
-
-
Save csuwildcat/5886961 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<x-control name="comment"> | |
<template> | |
<div class="comment"> | |
<label>User: <span class="user"></span></label> | |
<p></p> | |
<br /> | |
<span class="date"></span> | |
<button>Update</button> | |
<ul></ul> | |
</div> | |
</template> | |
<style> | |
.comment { | |
padding: 10px; | |
border-bottom: 1px solid #999; | |
} | |
.comment label { | |
font-weight: bold; | |
} | |
</style> | |
<script type="control"> | |
this.addListeners({ | |
'click:delegate(button)': function(){ | |
return { | |
'comment': 'Look ma, I just updated myself!' | |
} | |
} | |
}); | |
this.addBindings({ | |
'user:query(span.user)': function(value){ | |
this.innerHTML = value; | |
}, | |
'comment:query(div > p)': function(value){ | |
this.innerHTML = value; | |
}, | |
'date:query(span.date)': function(value){ | |
this.innerHTML = value; | |
}, | |
'replies:query(x-repeater)': function(value){ | |
this.foo = value; | |
} | |
}); | |
</script> | |
</x-control> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment