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

Change subject: Move Flow DM population to the bottom
......................................................................


Move Flow DM population to the bottom

The dm should populate after the navigation widget (and all other
ui widgets) are constructed, so they respond to the 'add' event
on the board.

Bug: T115265
Change-Id: I23252ef30d079ba5361702a34b8d93af882fcde0
---
M modules/flow-initialize.js
1 file changed, 17 insertions(+), 15 deletions(-)

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



diff --git a/modules/flow-initialize.js b/modules/flow-initialize.js
index 4cda684..5c2696c 100644
--- a/modules/flow-initialize.js
+++ b/modules/flow-initialize.js
@@ -99,21 +99,6 @@
                // We shouldn't have to worry about 'remove', since by the time 
we have filtering,
                // orderedTopicIds should be gone.
 
-               // Fall back to mw.flow.data, which was used until September 
2015
-               dataBlob = mw.config.get( 'wgFlowData' ) || ( mw.flow && 
mw.flow.data );
-               if ( dataBlob && dataBlob.blocks ) {
-                       // Populate the rendered topics or topic (if we are in 
a single-topic view)
-                       mw.flow.system.populateBoardTopicsFromJson( 
dataBlob.blocks.topiclist || dataBlob.blocks.topic );
-                       // Populate header
-                       mw.flow.system.populateBoardDescriptionFromJson( 
dataBlob.blocks.header || {} );
-                       // Populate the ToC topics
-                       if ( dataBlob.toc ) {
-                               mw.flow.system.populateBoardTopicsFromJson( 
dataBlob.toc );
-                       }
-               } else {
-                       mw.flow.system.populateBoardFromApi();
-               }
-
                // Initialize the old system to accept the default
                // 'newest' order for the topic order widget
                // Get the current default sort
@@ -535,6 +520,23 @@
                        return false;
                } );
 
+               // Fall back to mw.flow.data, which was used until September 
2015
+               // NOTICE: This block must be after the initialization of the 
ui widgets so
+               // they can populate themselves according to the events.
+               dataBlob = mw.config.get( 'wgFlowData' ) || ( mw.flow && 
mw.flow.data );
+               if ( dataBlob && dataBlob.blocks ) {
+                       // Populate the rendered topics or topic (if we are in 
a single-topic view)
+                       mw.flow.system.populateBoardTopicsFromJson( 
dataBlob.blocks.topiclist || dataBlob.blocks.topic );
+                       // Populate header
+                       mw.flow.system.populateBoardDescriptionFromJson( 
dataBlob.blocks.header || {} );
+                       // Populate the ToC topics
+                       if ( dataBlob.toc ) {
+                               mw.flow.system.populateBoardTopicsFromJson( 
dataBlob.toc );
+                       }
+               } else {
+                       mw.flow.system.populateBoardFromApi();
+               }
+
                preloadTopic = OO.getProp( dataBlob, 'blocks', 'topiclist', 
'submitted', 'topic' );
                preloadContent = OO.getProp( dataBlob, 'blocks', 'topiclist', 
'submitted', 'content' );
                preloadFormat = OO.getProp( dataBlob, 'blocks', 'topiclist', 
'submitted', 'format' );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I23252ef30d079ba5361702a34b8d93af882fcde0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to