Removing highlighting from mobile rcfilters
[lhc/web/wiklou.git] / resources / src / mediawiki.rcfilters / ui / ChangesListWrapperWidget.js
index 09b802e..f92685b 100644 (file)
@@ -28,7 +28,6 @@ var ChangesListWrapperWidget = function MwRcfiltersUiChangesListWrapperWidget(
        this.filtersViewModel = filtersViewModel;
        this.changesListViewModel = changesListViewModel;
        this.controller = controller;
-       this.highlightClasses = null;
 
        // Events
        this.filtersViewModel.connect( this, {
@@ -52,22 +51,6 @@ var ChangesListWrapperWidget = function MwRcfiltersUiChangesListWrapperWidget(
 
 OO.inheritClass( ChangesListWrapperWidget, OO.ui.Widget );
 
-/**
- * Get all available highlight classes
- *
- * @return {string[]} An array of available highlight class names
- */
-ChangesListWrapperWidget.prototype.getHighlightClasses = function () {
-       if ( !this.highlightClasses || !this.highlightClasses.length ) {
-               this.highlightClasses = this.filtersViewModel.getItemsSupportingHighlights()
-                       .map( function ( filterItem ) {
-                               return filterItem.getCssClass();
-                       } );
-       }
-
-       return this.highlightClasses;
-};
-
 /**
  * Respond to the highlight feature being toggled on and off
  *
@@ -118,7 +101,7 @@ ChangesListWrapperWidget.prototype.onModelUpdate = function (
                isEmpty = $changesListContent === 'NO_RESULTS',
                // For enhanced mode, we have to load these modules, which are
                // not loaded for the 'regular' mode in the backend
-               loaderPromise = mw.user.options.get( 'usenewrc' ) ?
+               loaderPromise = mw.user.options.get( 'usenewrc' ) && !OO.ui.isMobile() ?
                        mw.loader.using( [ 'mediawiki.special.changeslist.enhanced', 'mediawiki.icon' ] ) :
                        $.Deferred().resolve(),
                widget = this;
@@ -279,6 +262,7 @@ ChangesListWrapperWidget.prototype.updateEnhancedParentHighlight = function () {
 
                // Collect the relevant classes from the first nested child
                firstChildClasses = activeHighlightClasses.filter( function ( className ) {
+                       // eslint-disable-next-line no-jquery/no-class-state
                        return $table.find( 'tr:nth-child(2)' ).hasClass( className );
                } );
                // Filter the non-head rows and see if they all have the same classes
@@ -288,6 +272,7 @@ ChangesListWrapperWidget.prototype.updateEnhancedParentHighlight = function () {
                                $this = $( this );
 
                        classesInThisRow = activeHighlightClasses.filter( function ( className ) {
+                               // eslint-disable-next-line no-jquery/no-class-state
                                return $this.hasClass( className );
                        } );