Esanders has uploaded a new change for review.
https://gerrit.wikimedia.org/r/298485
Change subject: Fix vertical positioning of progress bar
......................................................................
Fix vertical positioning of progress bar
Bug: T140029
Change-Id: I5b38d375559449eded559e4443131516b1937b6d
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
1 file changed, 4 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/85/298485/1
diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
index 268d0eb..9a5fa19 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
@@ -48,15 +48,16 @@
);
}
+ // Center within visible part of the target
$content = $( '#content' );
contentRect = $content[ 0 ].getBoundingClientRect();
- offsetTop = $content.offset().top;
windowHeight = $( window ).height();
top = Math.max( contentRect.top, 0 );
bottom = Math.min( contentRect.bottom, windowHeight );
- middle = ( top + bottom ) / 2;
+ middle = ( bottom - top ) / 2;
+ offsetTop = Math.max( -contentRect.top, 0 );
- init.$loading.css( 'top', middle - offsetTop );
+ init.$loading.css( 'top', middle + offsetTop );
$content.prepend( init.$loading );
}
--
To view, visit https://gerrit.wikimedia.org/r/298485
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b38d375559449eded559e4443131516b1937b6d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits