diff --git a/src/demo-app/ripple/ripple-demo.html b/src/demo-app/ripple/ripple-demo.html index 71721acd91aa..0cec0791fbe3 100644 --- a/src/demo-app/ripple/ripple-demo.html +++ b/src/demo-app/ripple/ripple-demo.html @@ -23,7 +23,7 @@ Slow Normal - Fast + Fast
diff --git a/src/lib/checkbox/checkbox.html b/src/lib/checkbox/checkbox.html index 131bc4236544..d9dc0a5a2120 100644 --- a/src/lib/checkbox/checkbox.html +++ b/src/lib/checkbox/checkbox.html @@ -17,8 +17,7 @@ (click)="_onInputClick($event)">
+ [mdRippleCentered]="true">
{ this._isMousedown ? this._activeRipples.push(ripple) : this.fadeOutRipple(ripple); - }, duration * 1000); + }, duration); } /** Fades out a ripple element. */ diff --git a/src/lib/core/ripple/ripple.spec.ts b/src/lib/core/ripple/ripple.spec.ts index 531c982c7e12..314dc61b1b55 100644 --- a/src/lib/core/ripple/ripple.spec.ts +++ b/src/lib/core/ripple/ripple.spec.ts @@ -2,7 +2,7 @@ import {TestBed, ComponentFixture, fakeAsync, tick, inject} from '@angular/core/ import {Component, ViewChild} from '@angular/core'; import {MdRipple, MdRippleModule} from './ripple'; import {ViewportRuler} from '../overlay/position/viewport-ruler'; -import {RIPPLE_FADE_OUT_DURATION, RIPPLE_SPEED_PX_PER_SECOND} from './ripple-renderer'; +import {RIPPLE_FADE_OUT_DURATION, RIPPLE_FADE_IN_DURATION} from './ripple-renderer'; /** Creates a DOM mouse event. */ @@ -104,11 +104,8 @@ describe('MdRipple', () => { expect(rippleTarget.querySelectorAll('.mat-ripple-element').length).toBe(1); - // Determines the diagonal distance of the ripple target. - let diagonal = Math.sqrt(TARGET_HEIGHT * TARGET_HEIGHT + TARGET_WIDTH * TARGET_WIDTH); - - // Calculates the duration for fading in the ripple. Also adds the fade-out duration. - tick((diagonal / RIPPLE_SPEED_PX_PER_SECOND * 1000) + RIPPLE_FADE_OUT_DURATION); + // Calculates the duration for fading-in and fading-out the ripple. + tick(RIPPLE_FADE_IN_DURATION + RIPPLE_FADE_OUT_DURATION); expect(rippleTarget.querySelectorAll('.mat-ripple-element').length).toBe(0); })); diff --git a/src/lib/radio/radio.html b/src/lib/radio/radio.html index d278313d9dcc..d4293cbee92d 100644 --- a/src/lib/radio/radio.html +++ b/src/lib/radio/radio.html @@ -7,8 +7,7 @@
+ [mdRippleCentered]="true">