Sets the disabled state on the ripple instance corresponding to the given host element.
(host: HTMLElement, disabled: boolean)
| 123 | |
| 124 | /** Sets the disabled state on the ripple instance corresponding to the given host element. */ |
| 125 | setDisabled(host: HTMLElement, disabled: boolean): void { |
| 126 | const ripple = this._hosts.get(host); |
| 127 | |
| 128 | // If the ripple has already been instantiated, just disable it. |
| 129 | if (ripple) { |
| 130 | ripple.target.rippleDisabled = disabled; |
| 131 | |
| 132 | if (!disabled && !ripple.hasSetUpEvents) { |
| 133 | ripple.hasSetUpEvents = true; |
| 134 | ripple.renderer.setupTriggerEvents(host); |
| 135 | } |
| 136 | } else if (disabled) { |
| 137 | // Otherwise, set an attribute so we know what the |
| 138 | // disabled state should be when the ripple is initialized. |
| 139 | host.setAttribute(matRippleDisabled, ''); |
| 140 | } else { |
| 141 | host.removeAttribute(matRippleDisabled); |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | /** |
| 146 | * Handles creating and attaching component internals |
no test coverage detected