Jdlrobson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/199812
Change subject: Fixes to the page action tutorial
......................................................................
Fixes to the page action tutorial
* Trigger changed event whenever new styles pulled in.
* Loading watchstar styles and the tablet styles can impact the skin
so we should trigger the event here as well
* Avoid positioning issues on alpha
* Add debouncing to the resize event handler
* Don't trigger resize event on a scroll event
Bug: T91047
Change-Id: I1de85d748c3c49eefb58ffcaa33bf2435afb2146
---
M javascripts/Skin.js
M javascripts/modules/tutorials/ContentOverlay.js
2 files changed, 11 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/12/199812/1
diff --git a/javascripts/Skin.js b/javascripts/Skin.js
index 9a6d6d5..b5d0651 100644
--- a/javascripts/Skin.js
+++ b/javascripts/Skin.js
@@ -109,6 +109,7 @@
if ( self.page.inNamespace( '' ) ) {
mw.loader.using(
self.tabletModules ).always( function () {
self.off( '_resize' );
+ self.emit.call( self,
'changed' );
} );
}
}
@@ -118,6 +119,7 @@
// FIXME: Remove when cache has cleared.
if ( user.isAnon() && !context.isBetaGroupMember() ) {
mw.loader.using( 'mobile.watchstar.init' );
+ self.emit.call( self, 'changed' );
}
this.emit( '_resize' );
},
diff --git a/javascripts/modules/tutorials/ContentOverlay.js
b/javascripts/modules/tutorials/ContentOverlay.js
index 0d152a5..a04ece7 100644
--- a/javascripts/modules/tutorials/ContentOverlay.js
+++ b/javascripts/modules/tutorials/ContentOverlay.js
@@ -1,6 +1,7 @@
( function ( M, $ ) {
var ContentOverlay,
+ context = M.require( 'context' ),
skin = M.require( 'skin' ),
Overlay = M.require( 'Overlay' );
@@ -54,9 +55,15 @@
*/
_position: function ( $pa ) {
var paOffset = $pa.offset(),
- h = $pa.outerHeight( true );
+ h = $pa.outerHeight( true ),
+ y = paOffset.top;
- this.$el.css( 'top', paOffset.top + h );
+ // We only care about this in a border-box world which
is disabled in alpha.
+ if ( !context.isAlphaGroupMember() ) {
+ y += h;
+ }
+
+ this.$el.css( 'top', y );
},
/**
* Position overlay and add pointer arrow that points at
specified element
--
To view, visit https://gerrit.wikimedia.org/r/199812
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1de85d748c3c49eefb58ffcaa33bf2435afb2146
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits