RCFilters: Don't grey out results area when initializing, unless there's a default...
[lhc/web/wiklou.git] / resources / src / mediawiki.rcfilters / mw.rcfilters.init.js
index 0819351..20c1463 100644 (file)
                        new mw.rcfilters.ui.ChangesListWrapperWidget(
                                filtersModel, changesListModel, controller, $( '.mw-changeslist, .mw-changeslist-empty' ) );
 
+                       // Remove the -loading class that may have been added on the server side.
+                       // If we are in fact going to load a default saved query, this .initialize()
+                       // call will do that and add the -loading class right back.
+                       $( 'body' ).removeClass( 'mw-rcfilters-ui-loading' );
+
                        controller.initialize(
                                mw.config.get( 'wgStructuredChangeFilters' ),
                                mw.config.get( 'wgFormattedNamespaces' ),
@@ -50,8 +55,9 @@
                                filtersModel, changesListModel, controller, $( 'fieldset.cloptions' ) );
 
                        $( '.rcfilters-container' ).append( filtersWidget.$element );
-                       $( 'body' ).append( $overlay );
-                       $( '.rcfilters-head' ).addClass( 'mw-rcfilters-ui-ready' );
+                       $( 'body' )
+                               .append( $overlay )
+                               .addClass( 'mw-rcfilters-ui-initialized' );
 
                        $( 'a.mw-helplink' ).attr(
                                'href',
@@ -60,7 +66,8 @@
 
                        controller.replaceUrl();
 
-                       if ( currentPage === 'Special:Recentchanges' ) {
+                       if ( currentPage === 'Special:Recentchanges' ||
+                               currentPage === 'Special:Recentchangeslinked' ) {
                                $topLinks = $( '.mw-recentchanges-toplinks' ).detach();
 
                                rcTopSection = new mw.rcfilters.ui.RcTopSectionWidget(
                                );
                                filtersWidget.setTopSection( wlTopSection.$element );
                        } // end Special:WL
+
+                       /**
+                        * Fired when initialization of the filtering interface for changes list is complete.
+                        *
+                        * @event structuredChangeFilters_ui_initialized
+                        * @member mw.hook
+                        */
+                       mw.hook( 'structuredChangeFilters.ui.initialized' ).fire();
                }
        };