Also introduce a place for feature flags.
Change-Id: Id118b85c727a865745283ee8fabda7050f317ce1
* @private
*/
mw.rcfilters.Controller.prototype._shouldCheckForNewChanges = function () {
- var liveUpdateFeatureFlag = mw.config.get( 'wgStructuredChangeFiltersEnableLiveUpdate' ) ||
- new mw.Uri().query.liveupdate;
-
return !document.hidden &&
!this.filtersModel.hasConflict() &&
!this.changesListModel.getNewChangesExist() &&
!this.updatingChangesList &&
- liveUpdateFeatureFlag;
+ mw.rcfilters.featureFlags.liveUpdate;
};
/**
return result;
}
+ },
+ featureFlags: {
+ liveUpdate: mw.config.get( 'wgStructuredChangeFiltersEnableLiveUpdate' ) || new mw.Uri().query.liveupdate
}
};
}( mediaWiki ) );
.append( this.savedLinksListWidget.$element )
);
- if (
- mw.config.get( 'wgStructuredChangeFiltersEnableLiveUpdate' ) ||
- // Allow users to enable live update with ?liveupdate=1
- new mw.Uri().query.liveupdate
- ) {
+ if ( mw.rcfilters.featureFlags.liveUpdate ) {
$bottom.append( this.liveUpdateButton.$element );
}
this.$element.find( 'br' ).detach();
}
- this.$element.find(
- 'legend, .rclistfrom, .rcnotefrom, .rcoptions-listfromreset'
- ).detach();
+ if ( mw.rcfilters.featureFlags.liveUpdate ) {
+ this.$element.find(
+ 'legend, .rclistfrom, .rcnotefrom, .rcoptions-listfromreset'
+ ).detach();
+ }
if ( this.$element.text().trim() === '' ) {
this.$element.detach();