feat(ripple): list item md ripple

This commit is contained in:
Adam Bradley
2015-09-24 21:20:57 -05:00
parent e4a48baef0
commit 1243fcda2c
4 changed files with 27 additions and 3 deletions

View File

@ -15,6 +15,7 @@
border: 0; border: 0;
min-height: 4.4rem; min-height: 4.4rem;
text-align: initial; text-align: initial;
overflow: hidden;
background-color: $list-background-color; background-color: $list-background-color;
color: $list-text-color; color: $list-text-color;

View File

@ -189,3 +189,9 @@ $item-md-forward-icon-color: $item-md-border-color !default;
} }
} }
.item,
a.item,
button.item {
transition: background-color $button-md-transition-duration $button-md-animation-curve,
}

View File

@ -5,6 +5,7 @@ export class Activator {
constructor(app, config) { constructor(app, config) {
this.app = app; this.app = app;
this.queue = [];
this.active = []; this.active = [];
this.clearStateTimeout = 180; this.clearStateTimeout = 180;
this.clearAttempt = 0; this.clearAttempt = 0;
@ -20,9 +21,20 @@ export class Activator {
this.x = pointerX; this.x = pointerX;
this.y = pointerY; this.y = pointerY;
// remember this is the active element // queue to have this element activated
targetEle.classList.add(this.activatedClass); this.queue.push(targetEle);
this.active.push(targetEle);
raf(() => {
let targetEle;
for (let i = 0; i < this.queue.length; i++) {
targetEle = this.queue[i];
if (targetEle && targetEle.parentNode) {
this.active.push(targetEle);
targetEle.classList.add(this.activatedClass);
}
}
this.queue = [];
});
} }
upAction() { upAction() {
@ -54,6 +66,7 @@ export class Activator {
for (let i = 0; i < this.active.length; i++) { for (let i = 0; i < this.active.length; i++) {
this.active[i].classList.remove(this.activatedClass); this.active[i].classList.remove(this.activatedClass);
} }
this.queue = [];
this.active = []; this.active = [];
} }

View File

@ -18,3 +18,7 @@ md-ripple {
transform: scale(0.001) translateZ(0); transform: scale(0.001) translateZ(0);
} }
.item > md-ripple {
z-index: 0;
}