Merge "Remove the localStorage replication of the block cookie"
[lhc/web/wiklou.git] / resources / src / mediawiki.rcfilters / ui / mw.rcfilters.ui.FilterWrapperWidget.js
index 8afdc8a..1fba18c 100644 (file)
@@ -40,7 +40,7 @@
                                icon: 'feedback',
                                flags: [ 'progressive' ],
                                label: mw.msg( 'rcfilters-filterlist-feedbacklink' ),
-                               href: 'https://www.mediawiki.org/wiki/Help_talk:Edit_Review_Improvements/RC_filters'
+                               href: 'https://www.mediawiki.org/wiki/Help_talk:New_filters_for_edit_review'
                        } ).$element
                );
 
@@ -56,7 +56,8 @@
                                $content: this.filterPopup.$element,
                                $footer: $footer,
                                classes: [ 'mw-rcfilters-ui-filterWrapperWidget-popup' ],
-                               width: 650
+                               width: 650,
+                               hideWhenOutOfView: false
                        }
                } );
 
                        }
                } else {
                        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 );
+                       }
                }
        };
 
         */
        mw.rcfilters.ui.FilterWrapperWidget.prototype.scrollToTop = function ( $element, marginFromTop ) {
                var container = OO.ui.Element.static.getClosestScrollableContainer( $element[ 0 ], 'y' ),
-                       pos = OO.ui.Element.static.getRelativePosition( $element, $( container ) );
+                       pos = OO.ui.Element.static.getRelativePosition( $element, $( container ) ),
+                       containerScrollTop = $( container ).is( 'body, html' ) ? 0 : $( container ).scrollTop();
 
                // Scroll to item
                $( container ).animate( {
-                       scrollTop: $( container ).scrollTop() + pos.top + ( marginFromTop || 0 )
+                       scrollTop: containerScrollTop + pos.top - ( marginFromTop || 0 )
                } );
        };
 }( mediaWiki ) );