Skip to content

Commit 4f755cf

Browse files
devversionvivian-hu-zz
authored andcommittedJan 16, 2019
feat(ripples): support updating global ripple options at runtime (#14705)
* feat(ripples): support updating global ripple options at runtime * Allows updating any global ripple option at runtime. This makes it possible for developers to disable ripples at runtime. Closes #9729 * fixup! feat(ripples): support updating global ripple options at runtime Address feedback
1 parent f6d0ea8 commit 4f755cf

File tree

11 files changed

+183
-96
lines changed

11 files changed

+183
-96
lines changed
 

‎src/dev-app/dev-app-module.ts

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {CommonModule} from '@angular/common';
1212
import {HttpClientModule} from '@angular/common/http';
1313
import {NgModule} from '@angular/core';
1414
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
15+
import {MAT_RIPPLE_GLOBAL_OPTIONS} from '@angular/material';
1516
import {ExampleModule} from '@angular/material-examples';
1617
import {BrowserModule} from '@angular/platform-browser';
1718
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
@@ -50,6 +51,7 @@ import {ProgressBarDemo} from './progress-bar/progress-bar-demo';
5051
import {ProgressSpinnerDemo} from './progress-spinner/progress-spinner-demo';
5152
import {RadioDemo} from './radio/radio-demo';
5253
import {RippleDemo} from './ripple/ripple-demo';
54+
import {DevAppRippleOptions} from './ripple/ripple-options';
5355
import {DEV_APP_ROUTES} from './routes';
5456
import {ScreenTypeDemo} from './screen-type/screen-type-demo';
5557
import {SelectDemo} from './select/select-demo';
@@ -140,6 +142,7 @@ import {VirtualScrollDemo} from './virtual-scroll/virtual-scroll-demo';
140142
],
141143
providers: [
142144
{provide: OverlayContainer, useClass: FullscreenOverlayContainer},
145+
{provide: MAT_RIPPLE_GLOBAL_OPTIONS, useExisting: DevAppRippleOptions},
143146
],
144147
entryComponents: [
145148
ContentElementDialog,

‎src/dev-app/dev-app.html

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ <h1>Angular Material Demos</h1>
3434
<mat-icon>fullscreen</mat-icon>
3535
</button>
3636
<button mat-button (click)="toggleTheme()">{{dark ? 'Light' : 'Dark'}} theme</button>
37+
<button mat-button (click)="rippleOptions.disabled = !rippleOptions.disabled">
38+
{{rippleOptions.disabled ? 'Enable' : 'Disable'}} ripples
39+
</button>
3740
<button mat-button (click)="root.dir = (root.dir === 'rtl' ? 'ltr' : 'rtl')"
3841
title="Toggle between RTL and LTR">
3942
{{root.dir.toUpperCase()}}

‎src/dev-app/dev-app.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import {OverlayContainer} from '@angular/cdk/overlay';
1010
import {Component, ElementRef, ViewEncapsulation} from '@angular/core';
11+
import {DevAppRippleOptions} from './ripple/ripple-options';
1112

1213
/** Root component for the dev-app demos. */
1314
@Component({
@@ -69,7 +70,8 @@ export class DevAppComponent {
6970

7071
constructor(
7172
private _element: ElementRef<HTMLElement>,
72-
private _overlayContainer: OverlayContainer) {}
73+
private _overlayContainer: OverlayContainer,
74+
public rippleOptions: DevAppRippleOptions) {}
7375

7476
toggleFullscreen() {
7577
// Cast to `any`, because the typings don't include the browser-prefixed methods.

‎src/dev-app/ripple/ripple-options.ts

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
import {Injectable} from '@angular/core';
10+
import {RippleGlobalOptions} from '@angular/material';
11+
12+
/**
13+
* Global ripple options for the dev-app. The ripple options are used as a class
14+
* so that the global options can be changed at runtime.
15+
*/
16+
@Injectable({providedIn: 'root'})
17+
export class DevAppRippleOptions implements RippleGlobalOptions {
18+
19+
/** Whether ripples should be disabled */
20+
disabled: boolean = false;
21+
}

‎src/lib/chips/BUILD.bazel

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ ng_test_library(
5151
"@angular//packages/platform-browser/animations",
5252
"//src/cdk/a11y",
5353
"//src/cdk/bidi",
54+
"//src/lib/core",
5455
"//src/cdk/keycodes",
5556
"//src/cdk/platform",
5657
"//src/cdk/testing",

‎src/lib/chips/chip.spec.ts

+15-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {BACKSPACE, DELETE, SPACE} from '@angular/cdk/keycodes';
33
import {createKeyboardEvent, dispatchFakeEvent} from '@angular/cdk/testing';
44
import {Component, DebugElement} from '@angular/core';
55
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
6+
import {MAT_RIPPLE_GLOBAL_OPTIONS, RippleGlobalOptions} from '@angular/material/core';
67
import {By} from '@angular/platform-browser';
78
import {Subject} from 'rxjs';
89
import {MatChip, MatChipEvent, MatChipSelectionChange, MatChipsModule} from './index';
@@ -13,19 +14,22 @@ describe('Chips', () => {
1314
let chipDebugElement: DebugElement;
1415
let chipNativeElement: HTMLElement;
1516
let chipInstance: MatChip;
17+
let globalRippleOptions: RippleGlobalOptions;
1618

1719
let dir = 'ltr';
1820

1921
beforeEach(async(() => {
22+
globalRippleOptions = {};
2023
TestBed.configureTestingModule({
2124
imports: [MatChipsModule],
2225
declarations: [BasicChip, SingleChip],
23-
providers: [{
24-
provide: Directionality, useFactory: () => ({
26+
providers: [
27+
{provide: MAT_RIPPLE_GLOBAL_OPTIONS, useFactory: () => globalRippleOptions},
28+
{provide: Directionality, useFactory: () => ({
2529
value: dir,
2630
change: new Subject()
27-
})
28-
}]
31+
})},
32+
]
2933
});
3034

3135
TestBed.compileComponents();
@@ -203,6 +207,13 @@ describe('Chips', () => {
203207
subscription.unsubscribe();
204208
});
205209

210+
it('should be able to disable ripples through ripple global options at runtime', () => {
211+
expect(chipInstance.rippleDisabled).toBe(false, 'Expected chip ripples to be enabled.');
212+
213+
globalRippleOptions.disabled = true;
214+
215+
expect(chipInstance.rippleDisabled).toBe(true, 'Expected chip ripples to be disabled.');
216+
});
206217
});
207218

208219
describe('keyboard behavior', () => {

‎src/lib/chips/chip.ts

+8-16
Original file line numberDiff line numberDiff line change
@@ -123,21 +123,20 @@ export class MatChip extends _MatChipMixinBase implements FocusableOption, OnDes
123123
/** Reference to the RippleRenderer for the chip. */
124124
private _chipRipple: RippleRenderer;
125125

126-
/** Whether the ripples are globally disabled through the RippleGlobalOptions */
127-
private _ripplesGloballyDisabled = false;
128-
129126
/**
130-
* Ripple configuration for ripples that are launched on pointer down.
127+
* Ripple configuration for ripples that are launched on pointer down. The ripple config
128+
* is set to the global ripple options since we don't have any configurable options for
129+
* the chip ripples.
131130
* @docs-private
132131
*/
133-
rippleConfig: RippleConfig = {};
132+
rippleConfig: RippleConfig & RippleGlobalOptions;
134133

135134
/**
136135
* Whether ripples are disabled on interaction
137136
* @docs-private
138137
*/
139138
get rippleDisabled(): boolean {
140-
return this.disabled || this.disableRipple || this._ripplesGloballyDisabled;
139+
return this.disabled || this.disableRipple || !!this.rippleConfig.disabled;
141140
}
142141

143142
/** Whether the chip has focus. */
@@ -225,22 +224,15 @@ export class MatChip extends _MatChipMixinBase implements FocusableOption, OnDes
225224
constructor(public _elementRef: ElementRef,
226225
private _ngZone: NgZone,
227226
platform: Platform,
228-
@Optional() @Inject(MAT_RIPPLE_GLOBAL_OPTIONS) globalOptions: RippleGlobalOptions) {
227+
@Optional() @Inject(MAT_RIPPLE_GLOBAL_OPTIONS)
228+
globalRippleOptions: RippleGlobalOptions | null) {
229229
super(_elementRef);
230230

231231
this._addHostClassName();
232232

233233
this._chipRipple = new RippleRenderer(this, _ngZone, _elementRef, platform);
234234
this._chipRipple.setupTriggerEvents(_elementRef.nativeElement);
235-
236-
if (globalOptions) {
237-
// TODO(paul): Do not copy each option manually. Allow dynamic global option changes: #9729
238-
this._ripplesGloballyDisabled = !!globalOptions.disabled;
239-
this.rippleConfig = {
240-
animation: globalOptions.animation,
241-
terminateOnPointerUp: globalOptions.terminateOnPointerUp,
242-
};
243-
}
235+
this.rippleConfig = globalRippleOptions || {};
244236
}
245237

246238
_addHostClassName() {

‎src/lib/core/ripple/ripple.md

+46-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ and calling its `launch` method.
2020
### Ripple trigger
2121

2222
By default ripples will fade in on interaction with the directive's host element.
23-
In some situations, developers may want to show ripples on interaction with *some other* element,
23+
In some situations, developers may want to show ripples on interaction with *some other* element,
2424
but still want to have the ripples placed in another location. This can be done by specifying
2525
the `matRippleTrigger` option that expects a reference to an `HTMLElement`.
2626

@@ -29,7 +29,7 @@ the `matRippleTrigger` option that expects a reference to an `HTMLElement`.
2929
<div matRipple [matRippleTrigger]="trigger" class="my-ripple-container">
3030
<!-- This is the ripple container, but not the trigger element for ripples. -->
3131
</div>
32-
32+
3333
<div #trigger></div>
3434
</div>
3535
```
@@ -43,14 +43,14 @@ class MyComponent {
4343

4444
/** Reference to the directive instance of the ripple. */
4545
@ViewChild(MatRipple) ripple: MatRipple;
46-
46+
4747
/** Shows a centered and persistent ripple. */
4848
launchRipple() {
4949
const rippleRef = this.ripple.launch({
5050
persistent: true,
5151
centered: true
5252
});
53-
53+
5454
// Fade out the ripple later.
5555
rippleRef.fadeOut();
5656
}
@@ -91,7 +91,7 @@ const globalRippleConfig: RippleGlobalOptions = {
9191

9292
@NgModule({
9393
providers: [
94-
{provide: MAT_RIPPLE_GLOBAL_OPTIONS, useValue: globalRippleConfig}
94+
{provide: MAT_RIPPLE_GLOBAL_OPTIONS, useValue: globalRippleConfig}
9595
]
9696
})
9797
```
@@ -100,7 +100,7 @@ All available global options can be seen in the `RippleGlobalOptions` interface.
100100

101101
### Disabling animation
102102

103-
The animation of ripples can be disabled by using the `animation` global option. If the
103+
The animation of ripples can be disabled by using the `animation` global option. If the
104104
`enterDuration` and `exitDuration` is being set to `0`, ripples will just appear without any
105105
animation.
106106

@@ -139,3 +139,43 @@ const globalRippleConfig: RippleGlobalOptions = {
139139
terminateOnPointerUp: true
140140
};
141141
```
142+
143+
### Updating global options at runtime
144+
145+
To change global ripple options at runtime, just inject the `MAT_RIPPLE_GLOBAL_OPTIONS`
146+
provider and update the desired options.
147+
148+
There are various ways of injecting the global options. In order to make it easier to
149+
inject and update options at runtime, it's recommended to create a service that implements
150+
the `RippleGlobalOptions` interface.
151+
152+
```ts
153+
@Injectable({providedIn: 'root'})
154+
export class AppGlobalRippleOptions implements RippleGlobalOptions {
155+
/** Whether ripples should be disabled globally. */
156+
disabled: boolean = false;
157+
}
158+
```
159+
160+
```ts
161+
@NgModule({
162+
providers: [
163+
{provide: MAT_RIPPLE_GLOBAL_OPTIONS, useExisting: AppGlobalRippleOptions},
164+
]
165+
})
166+
export class MyModule {...}
167+
```
168+
169+
Now that the global ripple options are set to a service we can inject, the service can be
170+
used update any global ripple option at runtime.
171+
172+
```ts
173+
@Component(...)
174+
export class MyComponent {
175+
constructor(private _appRippleOptions: AppGlobalRippleOptions) {}
176+
177+
disableRipples() {
178+
this._appRippleOptions.disabled = true;
179+
}
180+
}
181+
```

‎src/lib/core/ripple/ripple.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export class MatRipple implements OnInit, OnDestroy, RippleTarget {
120120
constructor(private _elementRef: ElementRef<HTMLElement>,
121121
ngZone: NgZone,
122122
platform: Platform,
123-
@Optional() @Inject(MAT_RIPPLE_GLOBAL_OPTIONS) globalOptions: RippleGlobalOptions,
123+
@Optional() @Inject(MAT_RIPPLE_GLOBAL_OPTIONS) globalOptions?: RippleGlobalOptions,
124124
@Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string) {
125125

126126
this._globalOptions = globalOptions || {};

‎src/lib/tabs/tab-nav-bar/tab-nav-bar.spec.ts

+73-51
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {async, ComponentFixture, fakeAsync, TestBed, tick} from '@angular/core/testing';
22
import {Component, ViewChild, ViewChildren, QueryList} from '@angular/core';
3+
import {MAT_RIPPLE_GLOBAL_OPTIONS, RippleGlobalOptions} from '@angular/material/core';
34
import {By} from '@angular/platform-browser';
45
import {dispatchFakeEvent, dispatchMouseEvent} from '@angular/cdk/testing';
56
import {Direction, Directionality} from '@angular/cdk/bidi';
@@ -10,8 +11,11 @@ import {MatTabLink, MatTabNav, MatTabsModule} from '../index';
1011
describe('MatTabNavBar', () => {
1112
let dir: Direction = 'ltr';
1213
let dirChange = new Subject();
14+
let globalRippleOptions: RippleGlobalOptions;
1315

1416
beforeEach(async(() => {
17+
globalRippleOptions = {};
18+
1519
TestBed.configureTestingModule({
1620
imports: [MatTabsModule],
1721
declarations: [
@@ -21,10 +25,9 @@ describe('MatTabNavBar', () => {
2125
TabLinkWithNativeTabindexAttr,
2226
],
2327
providers: [
24-
{provide: Directionality, useFactory: () => ({
25-
value: dir,
26-
change: dirChange.asObservable()
27-
})},
28+
{provide: MAT_RIPPLE_GLOBAL_OPTIONS, useFactory: () => globalRippleOptions},
29+
{provide: Directionality, useFactory: () =>
30+
({value: dir, change: dirChange.asObservable()})},
2831
]
2932
});
3033

@@ -113,29 +116,6 @@ describe('MatTabNavBar', () => {
113116
.toBe(true, 'Expected aria-disabled to be set to "true" if link is disabled.');
114117
});
115118

116-
it('should disable the ripples on all tabs when they are disabled on the nav bar', () => {
117-
expect(fixture.componentInstance.tabLinks.toArray().every(tabLink => !tabLink.rippleDisabled))
118-
.toBe(true, 'Expected every tab link to have ripples enabled');
119-
120-
fixture.componentInstance.disableRippleOnBar = true;
121-
fixture.detectChanges();
122-
123-
expect(fixture.componentInstance.tabLinks.toArray().every(tabLink => tabLink.rippleDisabled))
124-
.toBe(true, 'Expected every tab link to have ripples disabled');
125-
});
126-
127-
it('should have the `disableRipple` from the tab take precendence over the nav bar', () => {
128-
const firstTab = fixture.componentInstance.tabLinks.first;
129-
130-
expect(firstTab.rippleDisabled).toBe(false, 'Expected ripples to be enabled on first tab');
131-
132-
firstTab.disableRipple = true;
133-
fixture.componentInstance.disableRippleOnBar = false;
134-
fixture.detectChanges();
135-
136-
expect(firstTab.rippleDisabled).toBe(true, 'Expected ripples to be disabled on first tab');
137-
});
138-
139119
it('should update the tabindex if links are disabled', () => {
140120
const tabLinkElements = fixture.debugElement.queryAll(By.css('a'))
141121
.map(tabLinkDebugEl => tabLinkDebugEl.nativeElement);
@@ -161,30 +141,6 @@ describe('MatTabNavBar', () => {
161141
expect(getComputedStyle(tabLinkElement).pointerEvents).toBe('none');
162142
});
163143

164-
it('should show ripples for tab links', () => {
165-
const tabLink = fixture.debugElement.nativeElement.querySelector('.mat-tab-link');
166-
167-
dispatchMouseEvent(tabLink, 'mousedown');
168-
dispatchMouseEvent(tabLink, 'mouseup');
169-
170-
expect(tabLink.querySelectorAll('.mat-ripple-element').length)
171-
.toBe(1, 'Expected one ripple to show up if user clicks on tab link.');
172-
});
173-
174-
it('should be able to disable ripples on a tab link', () => {
175-
const tabLinkDebug = fixture.debugElement.query(By.css('a'));
176-
const tabLinkElement = tabLinkDebug.nativeElement;
177-
const tabLinkInstance = tabLinkDebug.injector.get<MatTabLink>(MatTabLink);
178-
179-
tabLinkInstance.disableRipple = true;
180-
181-
dispatchMouseEvent(tabLinkElement, 'mousedown');
182-
dispatchMouseEvent(tabLinkElement, 'mouseup');
183-
184-
expect(tabLinkElement.querySelectorAll('.mat-ripple-element').length)
185-
.toBe(0, 'Expected no ripple to show up if ripples are disabled.');
186-
});
187-
188144
it('should re-align the ink bar when the direction changes', () => {
189145
const inkBar = fixture.componentInstance.tabNavBar._inkBar;
190146

@@ -285,6 +241,72 @@ describe('MatTabNavBar', () => {
285241

286242
expect(tabLink.tabIndex).toBe(3, 'Expected the tabIndex to be have been set to 3.');
287243
});
244+
245+
describe('ripples', () => {
246+
let fixture: ComponentFixture<SimpleTabNavBarTestApp>;
247+
248+
beforeEach(() => {
249+
fixture = TestBed.createComponent(SimpleTabNavBarTestApp);
250+
fixture.detectChanges();
251+
});
252+
253+
it('should be disabled on all tab links when they are disabled on the nav bar', () => {
254+
expect(fixture.componentInstance.tabLinks.toArray().every(tabLink => !tabLink.rippleDisabled))
255+
.toBe(true, 'Expected every tab link to have ripples enabled');
256+
257+
fixture.componentInstance.disableRippleOnBar = true;
258+
fixture.detectChanges();
259+
260+
expect(fixture.componentInstance.tabLinks.toArray().every(tabLink => tabLink.rippleDisabled))
261+
.toBe(true, 'Expected every tab link to have ripples disabled');
262+
});
263+
264+
it('should have the `disableRipple` from the tab take precedence over the nav bar', () => {
265+
const firstTab = fixture.componentInstance.tabLinks.first;
266+
267+
expect(firstTab.rippleDisabled).toBe(false, 'Expected ripples to be enabled on first tab');
268+
269+
firstTab.disableRipple = true;
270+
fixture.componentInstance.disableRippleOnBar = false;
271+
fixture.detectChanges();
272+
273+
expect(firstTab.rippleDisabled).toBe(true, 'Expected ripples to be disabled on first tab');
274+
});
275+
276+
it('should show up for tab link elements on mousedown', () => {
277+
const tabLink = fixture.debugElement.nativeElement.querySelector('.mat-tab-link');
278+
279+
dispatchMouseEvent(tabLink, 'mousedown');
280+
dispatchMouseEvent(tabLink, 'mouseup');
281+
282+
expect(tabLink.querySelectorAll('.mat-ripple-element').length)
283+
.toBe(1, 'Expected one ripple to show up if user clicks on tab link.');
284+
});
285+
286+
it('should be able to disable ripples on an individual tab link', () => {
287+
const tabLinkDebug = fixture.debugElement.query(By.css('a'));
288+
const tabLinkElement = tabLinkDebug.nativeElement;
289+
const tabLinkInstance = tabLinkDebug.injector.get<MatTabLink>(MatTabLink);
290+
291+
tabLinkInstance.disableRipple = true;
292+
293+
dispatchMouseEvent(tabLinkElement, 'mousedown');
294+
dispatchMouseEvent(tabLinkElement, 'mouseup');
295+
296+
expect(tabLinkElement.querySelectorAll('.mat-ripple-element').length)
297+
.toBe(0, 'Expected no ripple to show up if ripples are disabled.');
298+
});
299+
300+
it('should be able to disable ripples through global options at runtime', () => {
301+
expect(fixture.componentInstance.tabLinks.toArray().every(tabLink => !tabLink.rippleDisabled))
302+
.toBe(true, 'Expected every tab link to have ripples enabled');
303+
304+
globalRippleOptions.disabled = true;
305+
306+
expect(fixture.componentInstance.tabLinks.toArray().every(tabLink => tabLink.rippleDisabled))
307+
.toBe(true, 'Expected every tab link to have ripples disabled');
308+
});
309+
});
288310
});
289311

290312
@Component({

‎src/lib/tabs/tab-nav-bar/tab-nav-bar.ts

+9-17
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,6 @@ export class MatTabLink extends _MatTabLinkMixinBase
191191
/** Reference to the RippleRenderer for the tab-link. */
192192
protected _tabLinkRipple: RippleRenderer;
193193

194-
/** Whether the ripples are globally disabled through the RippleGlobalOptions */
195-
private _ripplesGloballyDisabled = false;
196-
197194
/** Whether the link is active. */
198195
@Input()
199196
get active(): boolean { return this._isActive; }
@@ -205,25 +202,28 @@ export class MatTabLink extends _MatTabLinkMixinBase
205202
}
206203

207204
/**
208-
* Ripple configuration for ripples that are launched on pointer down.
205+
* Ripple configuration for ripples that are launched on pointer down. The ripple config
206+
* is set to the global ripple options since we don't have any configurable options for
207+
* the tab link ripples.
209208
* @docs-private
210209
*/
211-
rippleConfig: RippleConfig = {};
210+
rippleConfig: RippleConfig & RippleGlobalOptions;
212211

213212
/**
214-
* Whether ripples are disabled on interaction
213+
* Whether ripples are disabled on interaction.
215214
* @docs-private
216215
*/
217216
get rippleDisabled(): boolean {
218217
return this.disabled || this.disableRipple || this._tabNavBar.disableRipple ||
219-
this._ripplesGloballyDisabled;
218+
!!this.rippleConfig.disabled;
220219
}
221220

222221
constructor(private _tabNavBar: MatTabNav,
223222
public _elementRef: ElementRef,
224223
ngZone: NgZone,
225224
platform: Platform,
226-
@Optional() @Inject(MAT_RIPPLE_GLOBAL_OPTIONS) globalOptions: RippleGlobalOptions,
225+
@Optional() @Inject(MAT_RIPPLE_GLOBAL_OPTIONS)
226+
globalRippleOptions: RippleGlobalOptions | null,
227227
@Attribute('tabindex') tabIndex: string,
228228
/**
229229
* @deprecated
@@ -234,18 +234,10 @@ export class MatTabLink extends _MatTabLinkMixinBase
234234

235235
this._tabLinkRipple = new RippleRenderer(this, ngZone, _elementRef, platform);
236236
this._tabLinkRipple.setupTriggerEvents(_elementRef.nativeElement);
237+
this.rippleConfig = globalRippleOptions || {};
237238

238239
this.tabIndex = parseInt(tabIndex) || 0;
239240

240-
if (globalOptions) {
241-
// TODO(paul): Do not copy each option manually. Allow dynamic global option changes: #9729
242-
this._ripplesGloballyDisabled = !!globalOptions.disabled;
243-
this.rippleConfig = {
244-
terminateOnPointerUp: globalOptions.terminateOnPointerUp,
245-
animation: globalOptions.animation,
246-
};
247-
}
248-
249241
if (_focusMonitor) {
250242
_focusMonitor.monitor(_elementRef);
251243
}

0 commit comments

Comments
 (0)
Please sign in to comment.