Skip to content

Instantly share code, notes, and snippets.

@leogomes
Created July 26, 2013 07:19
Show Gist options
  • Save leogomes/6086922 to your computer and use it in GitHub Desktop.
Save leogomes/6086922 to your computer and use it in GitHub Desktop.
Testing class changes
{
"name": "Testing class changes",
"description": "",
"data": {
"themes": [
{
"value": "theme1",
"label": "Black on lime"
},
{
"value": "theme2",
"label": "Navy on blue"
}
]
}
}
{macro main()}
<div {id "main"/} class="theme2">
<div {id "title"/} class="title">
<h1>Hello Instant Aria Templates</h1>
</div>
</div>
{@aria:SelectBox {
label: "New theme: ",
labelWidth:220,
options : data.themes,
onchange: changeColor,
bind : {
value : {
to : "theme",
inside : data
}
}
}/}
{/macro}
({
$classpath:'InstantTemplateScript',
$prototype : {
changeColor: function() {
//alert("New theme:" + this.data.theme);
this.$getElementById("main").setProperty('className', this.data.theme);
}
}
})
{macro main()}
.theme1 {
background-color : #000000;
}
.title {
cursor: pointer;
}
.theme1 .title {
color : #00ff00;
}
.theme2 {
background-color : #E1E6FC;
}
.theme2 .title {
color : #000080;
}
{/macro}
@leogomes
Copy link
Author

Created by Instant Aria Templates, viewable on http://instant.ariatemplates.com/leogomes/6086922

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment