JGonera has submitted this change and it was merged.

Change subject: Bug 47925: Let people toggle sections in editor
......................................................................


Bug 47925: Let people toggle sections in editor

Although we are rewriting editor lets make the existing one work
again!!

Change-Id: I7eea4b82d26c982776c48afb405a8d87dfa5afdd
---
M MobileFrontend.php
M javascripts/actions/mf-edit.js
2 files changed, 5 insertions(+), 4 deletions(-)

Approvals:
  JGonera: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/MobileFrontend.php b/MobileFrontend.php
index 2602e4b..43160a6 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -343,7 +343,7 @@
 );
 
 $wgResourceModules['mobile.action.edit'] = $wgMFMobileResourceBoilerplate + 
array(
-       'dependencies' => array( 'mobile.startup' ),
+       'dependencies' => array( 'mobile.startup', 'mobile.beta' ),
        'messages' => array(
                // mf-edit.js
                'mobile-frontend-page-saving',
diff --git a/javascripts/actions/mf-edit.js b/javascripts/actions/mf-edit.js
index daffe62..8c0ff5e 100644
--- a/javascripts/actions/mf-edit.js
+++ b/javascripts/actions/mf-edit.js
@@ -1,12 +1,13 @@
 ( function( M, $ ) {
 
 var m = ( function() {
-       var $pre = $( '<pre>' ).hide().appendTo( $( '#content_wrapper' ) ), 
minHeight = 80;
+       var $pre = $( '<pre>' ).hide().appendTo( $( '#content_wrapper' ) ), 
minHeight = 80,
+               toggling = M.require( 'toggle-dynamic' );
 
        function makeSection( $editArea, sectionId ) {
                var $section = $( '<div class="section">' ).insertBefore( 
$editArea ),
                        $heading = $( '<h2 class="section_heading">' ).attr( 
'id', 'section_edit' + sectionId ),
-                       $content = $( '<div class="content_block">' );
+                       $content = $( '<div class="content_block">' ).data( 
'loaded', true );
 
                if ( sectionId > 0 ) {
                        $section.append( $heading );
@@ -109,7 +110,7 @@
                        $editArea.val( val );
                } );
 
-               M.emit( 'page-loaded', { title: mw.config.get( 'wgTitle' ) } );
+               toggling.enableToggling( $( '#content_0' ) );
        }
 
        function init() {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7eea4b82d26c982776c48afb405a8d87dfa5afdd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to