Niedzielski has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/402082 )
Change subject: Update: hide section expansion option on large displays
......................................................................
Update: hide section expansion option on large displays
On large displays, don't show the "expand all sections" setting on
Special:MobileOptions. This option is only considered for small
displays.
Bug: T183493
Change-Id: I8e2beb2a6d4466f563759561a2c3e225deeae620
---
M resources/mobile.special.mobileoptions.scripts/mobileoptions.js
M resources/mobile.toggle/toggle.js
2 files changed, 10 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/82/402082/1
diff --git a/resources/mobile.special.mobileoptions.scripts/mobileoptions.js
b/resources/mobile.special.mobileoptions.scripts/mobileoptions.js
index 56842ca..434bf93 100644
--- a/resources/mobile.special.mobileoptions.scripts/mobileoptions.js
+++ b/resources/mobile.special.mobileoptions.scripts/mobileoptions.js
@@ -1,5 +1,6 @@
( function ( M, $ ) {
- var View = M.require( 'mobile.startup/View' );
+ var browser = M.require( 'mobile.startup/Browser' ).getSingleton(),
+ View = M.require( 'mobile.startup/View' );
/**
* Wrapper for checkboxes styled as in MediaWiki UI style guide
@@ -29,7 +30,7 @@
} );
/**
- * Add features, that depends on localStorage, such as "exapnd all
sections" or "fontchanger".
+ * Add features, that depends on localStorage, such as "expand all
sections" or "fontchanger".
* The checkbox is used for turning on/off expansion of all sections on
page load.
* @method
*/
@@ -37,7 +38,10 @@
var cb,
saveLI = $( '#mw-mf-settings-save' );
- if ( mw.config.get( 'wgMFExpandAllSectionsUserOption' ) ) {
+ if ( mw.config.get( 'wgMFExpandAllSectionsUserOption' ) &&
+ // Don't show this option on large screens since it's
only honored for small screens. This
+ // logic should be kept in sync with Toggle._enable().
+ !browser.isWideScreen() ) {
cb = new Checkbox( {
name: 'expandSections',
label: mw.msg(
'mobile-frontend-expand-sections-status' ),
diff --git a/resources/mobile.toggle/toggle.js
b/resources/mobile.toggle/toggle.js
index 621c52f..d325992 100644
--- a/resources/mobile.toggle/toggle.js
+++ b/resources/mobile.toggle/toggle.js
@@ -298,7 +298,9 @@
enableKeyboardActions( self, $heading );
if ( !isReferenceSection && ( !isClosed &&
browser.isWideScreen() || expandSections ) ) {
- // Expand sections by default on wide
screen devices or if the expand sections setting is set
+ // Expand sections by default on wide
screen devices or if the expand sections setting is
+ // set. The wide screen logic for
determining whether to collapse sections initially
+ // should be kept in sync with
mobileoptions#initLocalStorageElements().
self.toggle( $heading );
}
}
--
To view, visit https://gerrit.wikimedia.org/r/402082
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e2beb2a6d4466f563759561a2c3e225deeae620
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Niedzielski <[email protected]>
Gerrit-Reviewer: Sniedzielski <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits