Mooeypoo has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/343756 )
Change subject: RCFilters: Properly scroll popup to top if no selection is made ...................................................................... RCFilters: Properly scroll popup to top if no selection is made This is the proper way to make the popup scroll back up to the top of the list when no selection was made. Beware that it depends on the OOUI fix to be merged, and then the new OOUI release after that. Change-Id: Ia0005e847c73edb2221651dde08b543a84261479 Depends-On: I19665f26177d4a654bd024a929537e02a40900ec --- M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterWrapperWidget.js 1 file changed, 14 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/56/343756/1 diff --git a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterWrapperWidget.js b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterWrapperWidget.js index e64a4c0..317a006 100644 --- a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterWrapperWidget.js +++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterWrapperWidget.js @@ -71,7 +71,10 @@ enter: 'onTextInputEnter' } ); this.capsule.connect( this, { capsuleItemClick: 'onCapsuleItemClick' } ); - this.capsule.popup.connect( this, { toggle: 'onCapsulePopupToggle' } ); + this.capsule.popup.connect( this, { + toggle: 'onCapsulePopupToggle', + ready: 'onCapsulePopupReady' + } ); // Initialize this.$element @@ -119,6 +122,16 @@ }; /** + * Respond to popup ready event + */ + mw.rcfilters.ui.FilterWrapperWidget.prototype.onCapsulePopupReady = function () { + if ( !this.filterPopup.getSelectedFilter() ) { + // No selection - bring to top + this.capsule.popup.$body.scrollTop( 0 ); + } + }; + + /** * Respond to text input change * * @param {string} newValue Current value -- To view, visit https://gerrit.wikimedia.org/r/343756 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia0005e847c73edb2221651dde08b543a84261479 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Mooeypoo <mor...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits