jenkins-bot has submitted this change and it was merged.

Change subject: Memoize isWideScreen()
......................................................................


Memoize isWideScreen()

It is called multiple times, and each call triggers a reflow.

Change-Id: Id39ed25a854fa95fad074e985afb67ab5d49a3db
---
M resources/mobile.browser/browser.js
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Bmansurov: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/mobile.browser/browser.js 
b/resources/mobile.browser/browser.js
index 1da3cce..b6ec417 100644
--- a/resources/mobile.browser/browser.js
+++ b/resources/mobile.browser/browser.js
@@ -108,11 +108,11 @@
                 * @method
                 * @return {Boolean}
                 */
-               isWideScreen: function () {
+               isWideScreen: memoize( function () {
                        var val = parseInt( mw.config.get( 
'wgMFDeviceWidthTablet' ), 10 );
                        // Check portrait and landscape mode to be consistent
                        return window.innerWidth >= val || window.innerHeight 
>= val;
-               },
+               } ),
                /**
                 * Checks browser support for a given CSS property
                 * @param {String} [property] the name of the property being 
tested

-- 
To view, visit https://gerrit.wikimedia.org/r/311199
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id39ed25a854fa95fad074e985afb67ab5d49a3db
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <o...@wikimedia.org>
Gerrit-Reviewer: Bmansurov <bmansu...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to