From 1c203b92f3235e214b80cebc59dbaf2ebc32188f Mon Sep 17 00:00:00 2001 From: Jake Lauritsen Date: Mon, 22 Jul 2024 13:32:28 -0700 Subject: [PATCH] Make matchMedia static and update doc for closure --- src/layout/layout.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/layout/layout.js b/src/layout/layout.js index 7d13fbf6a..1dfcb1056 100644 --- a/src/layout/layout.js +++ b/src/layout/layout.js @@ -135,11 +135,11 @@ * * @private */ - MaterialLayout.prototype.matchMedia_ = function(query) { + MaterialLayout.matchMedia_ = function(query) { return window.matchMedia(query); }; - MaterialLayout.screenSizeMediaQuery_ = MaterialLayout.prototype.matchMedia_( + MaterialLayout.screenSizeMediaQuery_ = MaterialLayout.matchMedia_( /** @type {string} */ (MaterialLayout.prototype.Constant_.MAX_WIDTH)); MaterialLayout.screenSizeMediaQuery_.onchange = screenSizeHandler; @@ -188,16 +188,11 @@ } }; - /** - * @typedef {Object} Matchable - * @property {boolean} matches - Indicates if the media query condition is met. - */ - /** * Handles screen size changes by updating the layout and drawer elements * based on the media query change event status. * - * @param {Matchable} m - is any object that provides matches + * @param {!MediaQueryList|!MediaQueryListEvent} m - is any object that provides matches * */ function screenSizeHandler(m) {