Dr0ptp4kt has submitted this change and it was merged.
Change subject: Don't collapse nested tables.
......................................................................
Don't collapse nested tables.
See enwiki "San Francisco" article's "Climate" section.
Change-Id: I3ce830de1a6b52a46bbdc23aeff63f16d9cdebcc
---
M www/js/transforms.js
1 file changed, 9 insertions(+), 0 deletions(-)
Approvals:
Dr0ptp4kt: Looks good to me, approved
Fjalapeno: Looks good to me, but someone else must approve
diff --git a/www/js/transforms.js b/www/js/transforms.js
index 1478d42..b554357 100644
--- a/www/js/transforms.js
+++ b/www/js/transforms.js
@@ -137,9 +137,18 @@
}
}
+// From: http://stackoverflow.com/a/22119674/135557
+function findAncestor (el, cls) {
+ while ((el = el.parentElement) && !el.classList.contains(cls));
+ return el;
+}
+
transformer.register( "hideTables", function( content ) {
var tables = content.querySelectorAll( "table" );
for (var i = 0; i < tables.length; i++) {
+
+ if (findAncestor (tables[i], 'app_table_container')) continue;
+
//is the table already hidden? if so, don't worry about it
if (tables[i].style.display === 'none' ||
tables[i].classList.contains( 'navbox' ) || tables[i].classList.contains(
'vertical-navbox' ) || tables[i].classList.contains( 'navbox-inner' ) ||
tables[i].classList.contains( 'metadata' )) {
continue;
--
To view, visit https://gerrit.wikimedia.org/r/198772
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3ce830de1a6b52a46bbdc23aeff63f16d9cdebcc
Gerrit-PatchSet: 1
Gerrit-Project: apps/ios/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Mhurd <[email protected]>
Gerrit-Reviewer: Bgerstle <[email protected]>
Gerrit-Reviewer: Dr0ptp4kt <[email protected]>
Gerrit-Reviewer: Fjalapeno <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits