Esanders has uploaded a new change for review.
https://gerrit.wikimedia.org/r/230399
Change subject: Fix content padding when toolbar changes height
......................................................................
Fix content padding when toolbar changes height
Change-Id: Ice8a0d21a5a3116235e4243fa3f8e60d78d2a1c5
---
M resources/mobile.editor.ve/ve.init.mw.MobileFrontendArticleTarget.js
1 file changed, 15 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/99/230399/1
diff --git
a/resources/mobile.editor.ve/ve.init.mw.MobileFrontendArticleTarget.js
b/resources/mobile.editor.ve/ve.init.mw.MobileFrontendArticleTarget.js
index 8451afe..be53bdd 100644
--- a/resources/mobile.editor.ve/ve.init.mw.MobileFrontendArticleTarget.js
+++ b/resources/mobile.editor.ve/ve.init.mw.MobileFrontendArticleTarget.js
@@ -24,6 +24,7 @@
ve.init.mw.MobileFrontendArticleTarget.super.call( this, config );
this.overlay = overlay;
+ this.$overlay = overlay.$el;
this.$overlayContent = overlay.$el.find( '.overlay-content' );
this.$overlaySurface = overlay.$el.find( '.surface' );
@@ -51,6 +52,7 @@
ve.init.mw.MobileFrontendArticleTarget.super.prototype.destroy.call(
this );
$( this.getElementWindow() ).off( 'scroll',
this.onWindowScrollDebounced );
+ this.$overlay.css( 'padding-top', '' );
};
/**
@@ -110,12 +112,25 @@
.append( surface.$element.addClass( 'content' ) )
.show();
+ surface.getContext().connect( this, { resize: 'adjustContentPadding' }
);
+ this.adjustContentPadding();
+
// we have to do it here because contenteditable elements still do not
// exist when postRender is executed
// FIXME: Don't call a private method that is outside the class.
this.overlay._fixIosHeader( '[contenteditable]' );
};
+/**
+ * Match the content padding to the toolbar height
+ */
+ve.init.mw.MobileFrontendArticleTarget.prototype.adjustContentPadding =
function () {
+ this.$overlay.css(
+ 'padding-top',
+ this.getToolbar().$element.outerHeight()
+ );
+};
+
/*
* FIXME: @inheritdoc once this file is in the right repo
*/
--
To view, visit https://gerrit.wikimedia.org/r/230399
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice8a0d21a5a3116235e4243fa3f8e60d78d2a1c5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits