Esanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/268112

Change subject: getViewportDimensions: Fix calculation of 'bottom'
......................................................................

getViewportDimensions: Fix calculation of 'bottom'

When the top of the surface is in view, 'top' is clipped
to 0, so we can't calculate 'bottom' from this value.

Instead compute it as the height of the viewport added to
the surface scroll offset (-rect.top).

This fixes issues with DesktopContext floating near the
top of the page.

Change-Id: Ib0c06fe0d82eda1abb9151356025de995e5c0f45
---
M src/ui/ve.ui.Surface.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/12/268112/1

diff --git a/src/ui/ve.ui.Surface.js b/src/ui/ve.ui.Surface.js
index f2602e5..2c576ad 100644
--- a/src/ui/ve.ui.Surface.js
+++ b/src/ui/ve.ui.Surface.js
@@ -260,7 +260,7 @@
        }
 
        top = Math.max( this.toolbarHeight - rect.top, 0 );
-       bottom = top + $( this.getElementWindow() ).height() - 
this.toolbarHeight;
+       bottom = $( this.getElementWindow() ).height() - rect.top;
 
        return {
                top: top,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib0c06fe0d82eda1abb9151356025de995e5c0f45
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>

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

Reply via email to