- /**
- * Respond to capsule item click and make the popup scroll down to the requested item
- *
- * @param {mw.rcfilters.ui.CapsuleItemWidget} item Clicked item
- */
- mw.rcfilters.ui.FilterWrapperWidget.prototype.onCapsuleItemClick = function ( item ) {
- var filterName = item.getData(),
- // Find the item in the popup
- filterWidget = this.filterPopup.getItemWidget( filterName );
-
- // Highlight item
- this.filterPopup.select( filterName );
- this.capsule.select( item );
-
- this.capsule.popup.toggle( true );
- this.scrollToTop( filterWidget.$element );
- };
-
- /**
- * Respond to capsule popup ready event, fired after the popup is visible, positioned and clipped
- */
- mw.rcfilters.ui.FilterWrapperWidget.prototype.onCapsulePopupReady = function () {
- mw.hook( 'RcFilters.popup.open' ).fire( this.filterPopup.getSelectedFilter() );
-
- this.scrollToTop( this.capsule.$element, 10 );
- if ( !this.filterPopup.getSelectedFilter() ) {
- // No selection, scroll the popup list to top
- setTimeout( function () { this.capsule.popup.$body.scrollTop( 0 ); }.bind( this ), 0 );