Merge "Show a warning in edit preview when a template loop is detected"
[lhc/web/wiklou.git] / resources / src / mediawiki.rcfilters / ui / mw.rcfilters.ui.MenuSelectWidget.js
index c12e10e..07d4506 100644 (file)
@@ -34,8 +34,7 @@
 
                this.inputValue = '';
                this.$overlay = config.$overlay || this.$element;
-               this.$body = $( '<div>' )
-                               .addClass( 'mw-rcfilters-ui-menuSelectWidget-body' );
+               this.$body = $( '<div>' ).addClass( 'mw-rcfilters-ui-menuSelectWidget-body' );
                this.footers = [];
 
                // Parent
                                        views: footerData.views
                                };
 
-                       this.footers.push( adjustedData );
+                       if ( !footerData.disabled ) {
+                               this.footers.push( adjustedData );
 
-                       if ( isSticky ) {
-                               this.$element.append( adjustedData.$element );
-                       } else {
-                               this.$body.append( adjustedData.$element );
+                               if ( isSticky ) {
+                                       this.$element.append( adjustedData.$element );
+                               } else {
+                                       this.$body.append( adjustedData.$element );
+                               }
                        }
                }.bind( this ) );
 
                                .addClass( 'mw-rcfilters-ui-menuSelectWidget-view-' + viewName );
 
                        this.currentView = viewName;
+                       this.scrollToTop();
                        this.clip();
                }
        };
 
                        this.emit( 'itemVisibilityChange' );
                }
+
+               this.noResults.toggle( !this.getItems().some( function ( item ) {
+                       return item.isVisible();
+               } ) );
        };
 
        /**