Dbrant has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/372843 )
Change subject: Fix shifting-up of lead paragraph when not using RestBase.
......................................................................
Fix shifting-up of lead paragraph when not using RestBase.
When RestBase is disabled, I noticed that the lead paragraph was no longer
being shifted to the top (i.e. the infobox appears at the top instead).
This is because the recent lazy-loading functionality creates a virtual
DOM, whereas the shifting transform relies on the lead section to be
inside a real DOM for measuring the physical height of the lead paragraph.
This patch moves the transform logic for the lead section to a point after
the section is appended to the real DOM.
Change-Id: I100dea60b46cc20f71da0c2d8e296319a90a7616
---
M app/src/main/assets/bundle.js
M www/js/sections.js
2 files changed, 4 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia
refs/changes/43/372843/1
diff --git a/app/src/main/assets/bundle.js b/app/src/main/assets/bundle.js
index 68e0df6..b0303f3 100644
--- a/app/src/main/assets/bundle.js
+++ b/app/src/main/assets/bundle.js
@@ -375,13 +375,13 @@
content.innerHTML = payload.section.text;
content.id = "content_block_0";
- applySectionTransforms(content, true);
-
// append the content to the DOM now, so that we can obtain
// dimension measurements for items.
document.getElementById( "content" ).appendChild( content );
document.getElementById( "loading_sections").className = "loading";
+ applySectionTransforms(content, true);
+
bridge.sendMessage( "pageInfo", {
"issues" : collectIssues(),
"disambiguations" : collectDisambig()
diff --git a/www/js/sections.js b/www/js/sections.js
index cc1e590..ce05445 100644
--- a/www/js/sections.js
+++ b/www/js/sections.js
@@ -118,13 +118,13 @@
content.innerHTML = payload.section.text;
content.id = "content_block_0";
- applySectionTransforms(content, true);
-
// append the content to the DOM now, so that we can obtain
// dimension measurements for items.
document.getElementById( "content" ).appendChild( content );
document.getElementById( "loading_sections").className = "loading";
+ applySectionTransforms(content, true);
+
bridge.sendMessage( "pageInfo", {
"issues" : collectIssues(),
"disambiguations" : collectDisambig()
--
To view, visit https://gerrit.wikimedia.org/r/372843
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I100dea60b46cc20f71da0c2d8e296319a90a7616
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits