Robmoen has uploaded a new change for review. https://gerrit.wikimedia.org/r/220013
Change subject: Fix pointer position in page action overlay ...................................................................... Fix pointer position in page action overlay Emit change on skin when using gather or regular watchstar bug: T103213 Change-Id: I4946a0b1aa6c45b0c70e08f0efaeac616cadd7f7 --- M resources/ext.gather.init/init.js 1 file changed, 13 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Gather refs/changes/13/220013/1 diff --git a/resources/ext.gather.init/init.js b/resources/ext.gather.init/init.js index 38cbb9e..a66d75e 100644 --- a/resources/ext.gather.init/init.js +++ b/resources/ext.gather.init/init.js @@ -102,6 +102,8 @@ var shouldShow = shouldShowCollectionTutorial(), $menuItem = revealCollectionsInMainMenu(); + + watchstar = new CollectionsWatchstar( { page: page, isAnon: user.isAnon(), @@ -109,12 +111,17 @@ wasUserPrompted: shouldShow, isNewlyAuthenticatedUser: mw.util.getParamValue( 'article_action' ) === 'add_to_collection' } ); - watchstar.insertBefore( $star ); $star.remove(); - if ( shouldShow ) { - showPointer( watchstar ); - } + + // FIXME: Ideally, we should be able to depend on the skin 'change' event for positioning. + // However, something that is updating the dom is not emitting change on skin. + // For now this resolves https://phabricator.wikimedia.org/T103213 + setTimeout( function () { + if ( shouldShow ) { + showPointer( watchstar ); + } + }, 1 ); watchstar.on( 'completed', function ( firstTimeUser, isNewCollection ) { if ( isNewCollection ) { @@ -160,8 +167,9 @@ isAnon: user.isAnon(), isWatched: $star.hasClass( 'watched' ) } ); - skin.emit( 'changed' ); } + // Call this in either case + skin.emit( 'changed' ); } else { revealCollectionsInMainMenu(); } -- To view, visit https://gerrit.wikimedia.org/r/220013 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4946a0b1aa6c45b0c70e08f0efaeac616cadd7f7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Gather Gerrit-Branch: master Gerrit-Owner: Robmoen <rm...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits