Bmansurov has uploaded a new change for review.

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

Change subject: Toggle expanded sections only if they are not already expanded.
......................................................................

Toggle expanded sections only if they are not already expanded.

Bug: 72322
Change-Id: I2413fabeb21e86c05986e71d2baa21c83bac2665
---
M javascripts/modules/toggling/toggle.js
1 file changed, 9 insertions(+), 3 deletions(-)


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

diff --git a/javascripts/modules/toggling/toggle.js 
b/javascripts/modules/toggling/toggle.js
index a919200..737ca34 100644
--- a/javascripts/modules/toggling/toggle.js
+++ b/javascripts/modules/toggling/toggle.js
@@ -45,12 +45,18 @@
         */
        function expandStoredSections() {
                var expandedSections = getExpandedSections(),
-                       $headlines = $( '.section-heading span' ), $headline;
+                       $headlines = $( '.section-heading span' ), $headline,
+                       $sectionHeading;
 
                $headlines.each( function () {
                        $headline = $( this );
-                       if ( expandedSections[currentPageTitle][$headline.attr( 
'id' )] ) {
-                               toggle( $headline.parents( '.section-heading' ) 
);
+                       $sectionHeading = $headline.parents( '.section-heading' 
);
+                       // toggle only if the section is not already expanded
+                       if (
+                               
expandedSections[currentPageTitle][$headline.attr( 'id' )] &&
+                               !$sectionHeading.hasClass( 'open-block' )
+                       ) {
+                               toggle( $sectionHeading );
                        }
                } );
        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2413fabeb21e86c05986e71d2baa21c83bac2665
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Bmansurov <bmansu...@wikimedia.org>

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

Reply via email to