Jdlrobson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/71936


Change subject: Bug 43271: Always enable section collapsing html
......................................................................

Bug 43271: Always enable section collapsing html

Decide in javascript whether to collapse..

Change-Id: I7f360f5b571895597ba06e483bea3a910e446f87
---
M includes/formatters/MobileFormatterHTML.php
M javascripts/modules/mf-toggle.js
2 files changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/36/71936/1

diff --git a/includes/formatters/MobileFormatterHTML.php 
b/includes/formatters/MobileFormatterHTML.php
index 5f6b671..6e43c02 100644
--- a/includes/formatters/MobileFormatterHTML.php
+++ b/includes/formatters/MobileFormatterHTML.php
@@ -17,7 +17,7 @@
 
        protected function onHtmlReady( $html ) {
                wfProfileIn( __METHOD__ );
-               if ( $this->expandableSections && strlen( $html ) > 4000 ) {
+               if ( $this->expandableSections ) {
                        $html = $this->headingTransform( $html );
                }
                wfProfileOut( __METHOD__ );
diff --git a/javascripts/modules/mf-toggle.js b/javascripts/modules/mf-toggle.js
index d8cf443..f0ac72d 100644
--- a/javascripts/modules/mf-toggle.js
+++ b/javascripts/modules/mf-toggle.js
@@ -39,6 +39,11 @@
                $( '#content_wrapper a' ).on( 'click', checkHash );
        }
 
+       // page is not long enough to collapse so don't worry
+       if ( $( '#content' ).text().length < 4000 ) {
+               init();
+       }
+
        return {
                wm_reveal_for_hash: wm_reveal_for_hash,
                wm_toggle_section: wm_toggle_section,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7f360f5b571895597ba06e483bea3a910e446f87
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to