Highlight selected item

This commit is contained in:
Martin Kleinschrodt 2013-11-21 11:29:17 +01:00
parent e0ec032802
commit 5e2baa90ba
2 changed files with 16 additions and 1 deletions

View File

@ -72,6 +72,16 @@
var direction = event.animationName == "slideOutToLeft" ? "out" : "in";
this.fire("animation-end", {direction: direction});
}
},
selectedChanged: function() {
var selected = this.selected;
this.$.list.children.array().forEach(function(item) {
if (item.record == selected) {
item.classList.add("selected");
} else {
item.classList.remove("selected");
}
});
}
});
</script>

View File

@ -44,6 +44,7 @@
background: #fff;
border-bottom: solid 1px rgba(0, 0, 0, 0.1);
margin-top: 5px;
-webkit-transition: background 0.2s;
}
/*:host:not(:last-child) {
@ -54,8 +55,12 @@
background: rgba(0, 0, 0, 0.05);
}
:host:active:hover:not(.disabled) .inner {
/*:host:active:hover:not(.disabled) .inner {
background: rgba(0, 0, 0, 0.1);
}*/
:host.selected .inner {
background: orange;
}
.delete {