Replace .parent with .super

Also remove unused config fallbacks

Change-Id: I10b1ffc0cf69c52c4394f27c02aac5bca2473374
This commit is contained in:
Ed Sanders 2018-05-22 15:56:46 +01:00
parent 3b4be7b6c5
commit 9de02857ae
32 changed files with 51 additions and 58 deletions

View file

@ -16,7 +16,7 @@
config = config || {};
// Parent constructor
mw.echo.api.ForeignAPIHandler.parent.call( this, config );
mw.echo.api.ForeignAPIHandler.super.call( this, config );
this.api = new mw.ForeignApi( apiUrl );
this.unreadOnly = config.unreadOnly !== undefined ? !!config.unreadOnly : false;

View file

@ -9,10 +9,8 @@
* @param {Object} [config] Configuration object
*/
mw.echo.api.LocalAPIHandler = function MwEchoApiLocalAPIHandler( config ) {
config = config || {};
// Parent constructor
mw.echo.api.LocalAPIHandler.parent.call( this,
mw.echo.api.LocalAPIHandler.super.call( this,
new mw.Api( { ajax: { cache: false } } ),
config
);

View file

@ -12,9 +12,8 @@
* @param {Object} [config] Configuration object
*/
mw.echo.dm.BundleNotificationItem = function MwEchoDmBundleNotificationItem( id, bundledNotificationModels, config ) {
config = config || {};
mw.echo.dm.BundleNotificationItem.parent.call( this, id, config );
// Parent constructor
mw.echo.dm.BundleNotificationItem.super.call( this, id, config );
this.getSecondaryUrls().forEach( function ( link ) {
// hack: put all secondary actions in the menu for now

View file

@ -15,7 +15,7 @@
mw.echo.dm.CrossWikiNotificationItem = function MwEchoDmCrossWikiNotificationItem( id, config ) {
config = config || {};
mw.echo.dm.CrossWikiNotificationItem.parent.call( this, id, config );
mw.echo.dm.CrossWikiNotificationItem.super.call( this, id, config );
this.foreign = true;
this.source = null;

View file

@ -18,7 +18,7 @@
config = config || {};
// Parent constructor
mw.echo.dm.NotificationGroupsList.parent.call( this );
mw.echo.dm.NotificationGroupsList.super.call( this );
// Sorting callback
this.setSortingCallback( function ( a, b ) {

View file

@ -26,7 +26,7 @@
config = config || {};
// Parent constructor
mw.echo.dm.NotificationsList.parent.call( this );
mw.echo.dm.NotificationsList.super.call( this );
this.name = config.name || 'local';
this.source = config.source || 'local';

View file

@ -24,7 +24,7 @@
config = config || {};
// Parent constructor
mw.echo.ui.ActionMenuPopupWidget.parent.call( this, config );
mw.echo.ui.ActionMenuPopupWidget.super.call( this, config );
this.$overlay = config.$overlay || this.$element;

View file

@ -16,7 +16,7 @@
config = config || {};
// Parent constructor
mw.echo.ui.BadgeLinkWidget.parent.call( this, config );
mw.echo.ui.BadgeLinkWidget.super.call( this, config );
// Mixin constructors
OO.ui.mixin.LabelElement.call( this, $.extend( { $label: this.$element }, config ) );

View file

@ -19,7 +19,7 @@
config = config || {};
// Parent constructor
mw.echo.ui.BundleNotificationItemWidget.parent.call( this, controller, model, config );
mw.echo.ui.BundleNotificationItemWidget.super.call( this, controller, model, config );
this.toggleMarkAsReadButtons( true );

View file

@ -18,8 +18,8 @@
mw.echo.ui.ClonedNotificationItemWidget = function MwEchoUiClonedNotificationItemWidget( $element, config ) {
config = config || {};
// Parent
mw.echo.ui.ClonedNotificationItemWidget.parent.call( this, config );
// Parent constructor
mw.echo.ui.ClonedNotificationItemWidget.super.call( this, config );
this.$element = $element;
this.timestamp = config.timestamp || moment.utc().format( 'YYYY-MM-DD[T]HH:mm:ss[Z]' );

View file

@ -16,7 +16,7 @@
config = config || {};
// Parent constructor
mw.echo.ui.ConfirmationPopupWidget.parent.call( this, config );
mw.echo.ui.ConfirmationPopupWidget.super.call( this, config );
this.labelWidget = new OO.ui.LabelWidget( config );
this.iconWidget = new OO.ui.IconWidget( $.extend( { icon: 'checkAll' }, config ) );

View file

@ -24,7 +24,7 @@
config = config || {};
// Parent constructor
mw.echo.ui.CrossWikiNotificationItemWidget.parent.call( this, controller, model, config );
mw.echo.ui.CrossWikiNotificationItemWidget.super.call( this, controller, model, config );
// Mixin constructors
OO.ui.mixin.PendingElement.call( this, config );
@ -143,8 +143,8 @@
this.controller.getTypeString() // The type of the list in general
);
// Parent
return mw.echo.ui.CrossWikiNotificationItemWidget.parent.prototype.onMarkAsReadButtonClick.call( this );
// Parent method
return mw.echo.ui.CrossWikiNotificationItemWidget.super.prototype.onMarkAsReadButtonClick.call( this );
};
/**

View file

@ -16,8 +16,8 @@
config = config || {};
// Parent
mw.echo.ui.CrossWikiUnreadFilterWidget.parent.call( this,
// Parent constructor
mw.echo.ui.CrossWikiUnreadFilterWidget.super.call( this,
// Sorting callback
function ( a, b ) {
var diff;

View file

@ -17,7 +17,7 @@
config = config || {};
// Parent constructor
mw.echo.ui.DatedNotificationsWidget.parent.call( this, config );
mw.echo.ui.DatedNotificationsWidget.super.call( this, config );
// Mixin constructors
OO.ui.mixin.PendingElement.call( this, config );

View file

@ -22,10 +22,8 @@
.addClass( 'mw-echo-ui-datedSubGroupListWidget-title' )
.append( $primaryDate, $secondaryDate );
config = config || {};
// Parent constructor
mw.echo.ui.DatedSubGroupListWidget.parent.call( this, controller, listModel, $.extend( {
mw.echo.ui.DatedSubGroupListWidget.super.call( this, controller, listModel, $.extend( {
// Since this widget is defined as a dated list, we sort
// its items according to timestamp without consideration
// of read state or foreignness.

View file

@ -20,7 +20,7 @@
config = config || {};
// Parent constructor
mw.echo.ui.FooterNoticeWidget.parent.call( this, config );
mw.echo.ui.FooterNoticeWidget.super.call( this, config );
if ( config.iconUrl ) {
$icon = $( '<div>' )

View file

@ -22,7 +22,7 @@
this.isLink = config.url && !this.isDynamicAction();
// Parent constructor
mw.echo.ui.MenuItemWidget.parent.call( this, config );
mw.echo.ui.MenuItemWidget.super.call( this, config );
// Mixin constructors
OO.ui.mixin.PendingElement.call( this, config );
@ -77,7 +77,7 @@
// If we have a link force selectability to false, otherwise defer to parent method
// Without a link (for dynamic actions or specific internal actions) we need this widget
// to be selectable so it emits the 'choose' event
return !this.isLink && mw.echo.ui.MenuItemWidget.parent.prototype.isSelectable.apply( this, arguments );
return !this.isLink && mw.echo.ui.MenuItemWidget.super.prototype.isSelectable.apply( this, arguments );
};
/**

View file

@ -31,7 +31,7 @@
config = config || {};
// Parent constructor
mw.echo.ui.NotificationBadgeWidget.parent.call( this, config );
mw.echo.ui.NotificationBadgeWidget.super.call( this, config );
// Mixin constructors
OO.ui.mixin.PendingElement.call( this, config );

View file

@ -22,8 +22,8 @@
config = config || {};
// Parent
mw.echo.ui.NotificationItemWidget.parent.call( this, $.extend( { data: model.getId() }, config ) );
// Parent constructor
mw.echo.ui.NotificationItemWidget.super.call( this, $.extend( { data: model.getId() }, config ) );
this.controller = controller;
this.model = model;

View file

@ -18,8 +18,8 @@
config = config || {};
// Parent
mw.echo.ui.NotificationsInboxWidget.parent.call( this, config );
// Parent constructor
mw.echo.ui.NotificationsInboxWidget.super.call( this, config );
// Mixin constructors
OO.ui.mixin.PendingElement.call( this, config );

View file

@ -17,7 +17,7 @@
mw.echo.ui.NotificationsListWidget = function MwEchoUiNotificationsListWidget( controller, manager, config ) {
config = config || {};
// Parent constructor
mw.echo.ui.NotificationsListWidget.parent.call(
mw.echo.ui.NotificationsListWidget.super.call(
this,
// Sorting callback
function ( a, b ) {

View file

@ -15,7 +15,7 @@
config = config || {};
// Parent constructor
mw.echo.ui.NotificationsWrapper.parent.call( this, config );
mw.echo.ui.NotificationsWrapper.super.call( this, config );
// Mixin constructor
OO.ui.mixin.PendingElement.call( this, config );

View file

@ -17,8 +17,8 @@
mw.echo.ui.PageFilterWidget = function MwEchoUiPageFilterWidget( filterModel, source, config ) {
config = config || {};
// Parent
mw.echo.ui.PageFilterWidget.parent.call( this, config );
// Parent constructor
mw.echo.ui.PageFilterWidget.super.call( this, config );
this.model = filterModel;
this.source = source;

View file

@ -17,8 +17,8 @@
config = config || {};
// Parent
mw.echo.ui.PageNotificationsOptionWidget.parent.call( this, config );
// Parent constructor
mw.echo.ui.PageNotificationsOptionWidget.super.call( this, config );
// Mixin constructors
OO.ui.mixin.IconElement.call( this, config );
OO.ui.mixin.TitledElement.call( this, config );
@ -85,7 +85,7 @@
};
mw.echo.ui.PageNotificationsOptionWidget.prototype.setPressed = function ( state ) {
mw.echo.ui.PageNotificationsOptionWidget.parent.prototype.setPressed.call( this, state );
mw.echo.ui.PageNotificationsOptionWidget.super.prototype.setPressed.call( this, state );
if ( this.pressed ) {
this.setFlags( 'progressive' );
} else if ( !this.selected ) {
@ -95,7 +95,7 @@
};
mw.echo.ui.PageNotificationsOptionWidget.prototype.setSelected = function ( state ) {
mw.echo.ui.PageNotificationsOptionWidget.parent.prototype.setSelected.call( this, state );
mw.echo.ui.PageNotificationsOptionWidget.super.prototype.setSelected.call( this, state );
if ( this.selected ) {
this.setFlags( 'progressive' );
} else {

View file

@ -20,8 +20,8 @@
mw.echo.ui.PaginationWidget = function MwEchoUiPaginationWidget( paginationModel, config ) {
config = config || {};
// Parent
mw.echo.ui.PaginationWidget.parent.call( this, config );
// Parent constructor
mw.echo.ui.PaginationWidget.super.call( this, config );
this.model = paginationModel;
@ -135,8 +135,8 @@
* @chainable
*/
mw.echo.ui.PaginationWidget.prototype.setDisabled = function ( disabled ) {
// Parent
mw.echo.ui.PaginationWidget.parent.prototype.setDisabled.call( this, disabled );
// Parent method
mw.echo.ui.PaginationWidget.super.prototype.setDisabled.call( this, disabled );
if (
this.dirSelectWidget &&

View file

@ -14,7 +14,7 @@
config = config || {};
// Parent constructor
mw.echo.ui.PlaceholderItemWidget.parent.call( this, $.extend( { data: null }, config ) );
mw.echo.ui.PlaceholderItemWidget.super.call( this, $.extend( { data: null }, config ) );
// Mixin constructor
OO.ui.mixin.LabelElement.call( this, config );

View file

@ -9,10 +9,8 @@
* @param {Object} [config] Configuration object
*/
mw.echo.ui.ReadStateButtonSelectWidget = function MwEchoUiReadStateButtonSelectWidget( config ) {
config = config || {};
// Parent
mw.echo.ui.ReadStateButtonSelectWidget.parent.call( this, $.extend( config, {
// Parent constructor
mw.echo.ui.ReadStateButtonSelectWidget.super.call( this, $.extend( config, {
items: [
new OO.ui.ButtonOptionWidget( {
data: 'all',

View file

@ -18,7 +18,7 @@
config = config || {};
// Parent constructor
mw.echo.ui.SingleNotificationItemWidget.parent.call( this, controller, model, config );
mw.echo.ui.SingleNotificationItemWidget.super.call( this, controller, model, config );
// Mixin constructors
OO.ui.mixin.PendingElement.call( this, config );
@ -83,8 +83,8 @@
mw.echo.ui.SingleNotificationItemWidget.prototype.toggleRead = function ( read ) {
var oldState = this.read;
// Parent
mw.echo.ui.SingleNotificationItemWidget.parent.prototype.toggleRead.call( this, read );
// Parent method
mw.echo.ui.SingleNotificationItemWidget.super.prototype.toggleRead.call( this, read );
if ( oldState !== read ) {
this.emit( 'sortChange' );

View file

@ -22,7 +22,7 @@
config = config || {};
// Parent constructor
mw.echo.ui.SortedListWidget.parent.call( this, config );
mw.echo.ui.SortedListWidget.super.call( this, config );
// Mixin constructor
OO.SortedEmitterList.call( this, sortingCallback );

View file

@ -11,7 +11,7 @@
config = config || {};
// Parent constructor
mw.echo.ui.SpecialHelpMenuWidget.parent.call( this, $.extend( {
mw.echo.ui.SpecialHelpMenuWidget.super.call( this, $.extend( {
icon: 'advanced',
indicator: 'down',
popup: {

View file

@ -25,7 +25,7 @@
this.model = listModel;
// Parent constructor
mw.echo.ui.SubGroupListWidget.parent.call( this, $.extend( { data: this.getSource() }, config ) );
mw.echo.ui.SubGroupListWidget.super.call( this, $.extend( { data: this.getSource() }, config ) );
this.showTitle = !!config.showTitle;
this.showMarkAllRead = !!config.showMarkAllRead;

View file

@ -13,8 +13,8 @@
mw.echo.ui.ToggleReadCircleButtonWidget = function MwEchoUiToggleReadCircleButtonWidget( config ) {
config = config || {};
// Parent
mw.echo.ui.ToggleReadCircleButtonWidget.parent.call( this, config );
// Parent constructor
mw.echo.ui.ToggleReadCircleButtonWidget.super.call( this, config );
this.$circle = $( '<div>' )
.addClass( 'mw-echo-ui-toggleReadCircleButtonWidget-circle' );