Merge "API: Always select rc_user from database (regardless of rcprop=user)"
[lhc/web/wiklou.git] / resources / src / mediawiki.rcfilters / ui / FilterWrapperWidget.js
index ce9656e..5893a6c 100644 (file)
@@ -47,7 +47,8 @@ FilterWrapperWidget = function MwRcfiltersUiFilterWrapperWidget(
                {
                        $overlay: this.$overlay,
                        collapsed: config.collapsed,
-                       $wrapper: this.$wrapper
+                       $wrapper: this.$wrapper,
+                       isMobile: OO.ui.isMobile()
                }
        );
 
@@ -67,7 +68,6 @@ FilterWrapperWidget = function MwRcfiltersUiFilterWrapperWidget(
        this.showNewChangesLink = new OO.ui.ButtonWidget( {
                icon: 'reload',
                framed: false,
-               label: mw.msg( 'rcfilters-show-new-changes' ),
                flags: [ 'progressive' ],
                classes: [ 'mw-rcfilters-ui-filterWrapperWidget-showNewChanges' ]
        } );
@@ -83,7 +83,11 @@ FilterWrapperWidget = function MwRcfiltersUiFilterWrapperWidget(
                .addClass( 'mw-rcfilters-ui-filterWrapperWidget-top' );
 
        $bottom = $( '<div>' )
-               .addClass( 'mw-rcfilters-ui-filterWrapperWidget-bottom' )
+               .addClass( OO.ui.isMobile() ?
+                       'mw-rcfilters-ui-filterWrapperWidget-bottom ' +
+                       'mw-rcfilters-ui-filterWrapperWidget-bottom-mobile' :
+                       'mw-rcfilters-ui-filterWrapperWidget-bottom'
+               )
                .append(
                        this.showNewChangesLink.$element,
                        this.numChangesAndDateWidget.$element
@@ -131,6 +135,14 @@ FilterWrapperWidget.prototype.onShowNewChangesClick = function () {
  * @param {boolean} newChangesExist Whether new changes exist
  */
 FilterWrapperWidget.prototype.onNewChangesExist = function ( newChangesExist ) {
+       if ( newChangesExist ) {
+               this.showNewChangesLink.setLabel(
+                       mw.message(
+                               'rcfilters-show-new-changes',
+                               this.changesListModel.getNextFromFormatted()
+                       ).text()
+               );
+       }
        this.showNewChangesLink.toggle( newChangesExist );
 };