mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
feat(ripple): list item md ripple
This commit is contained in:
@ -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;
|
||||||
|
@ -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,
|
||||||
|
}
|
||||||
|
@ -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 = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,3 +18,7 @@ md-ripple {
|
|||||||
|
|
||||||
transform: scale(0.001) translateZ(0);
|
transform: scale(0.001) translateZ(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.item > md-ripple {
|
||||||
|
z-index: 0;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user