diff --git a/packages/mdc-ripple/foundation.js b/packages/mdc-ripple/foundation.js index c1136f4e2e7..14104782b96 100644 --- a/packages/mdc-ripple/foundation.js +++ b/packages/mdc-ripple/foundation.js @@ -106,17 +106,6 @@ class MDCRippleFoundation extends MDCFoundation { }; } - /** - * We compute this property so that we are not querying information about the client - * until the point in time where the foundation requests it. This prevents scenarios where - * client-side feature-detection may happen too early, such as when components are rendered on the server - * and then initialized at mount time on the client. - * @return {boolean} - */ - get isSupported_() { - return this.adapter_.browserSupportsCssVars(); - } - constructor(adapter) { super(Object.assign(MDCRippleFoundation.defaultAdapter, adapter)); @@ -187,6 +176,18 @@ class MDCRippleFoundation extends MDCFoundation { }; } + /** + * We compute this property so that we are not querying information about the client + * until the point in time where the foundation requests it. This prevents scenarios where + * client-side feature-detection may happen too early, such as when components are rendered on the server + * and then initialized at mount time on the client. + * @return {boolean} + * @private + */ + isSupported_() { + return this.adapter_.browserSupportsCssVars(); + } + /** * @return {!ActivationStateType} */ @@ -203,7 +204,7 @@ class MDCRippleFoundation extends MDCFoundation { } init() { - if (!this.isSupported_) { + if (!this.isSupported_()) { return; } this.addEventListeners_(); @@ -266,8 +267,11 @@ class MDCRippleFoundation extends MDCFoundation { }); } - activate() { - this.activate_(null); + /** + * @param {?Event=} event Optional event containing position information. + */ + activate(event = null) { + this.activate_(event); } /** @private */ @@ -405,8 +409,11 @@ class MDCRippleFoundation extends MDCFoundation { }); } - deactivate() { - this.deactivate_(null); + /** + * @param {?Event=} event Optional event containing position information. + */ + deactivate(event = null) { + this.deactivate_(event); } /** @@ -424,7 +431,7 @@ class MDCRippleFoundation extends MDCFoundation { } destroy() { - if (!this.isSupported_) { + if (!this.isSupported_()) { return; } this.removeEventListeners_();