Use 'super' to call parent methods

Change-Id: Iba051a1e84b2ea805d0b3795933587c735ec0d88
This commit is contained in:
Ed Sanders 2016-11-02 12:43:14 +00:00
parent 4f0fb1402b
commit f4240f13f9
8 changed files with 20 additions and 19 deletions

View file

@ -16,9 +16,9 @@
* @param {ve.dm.MWReferenceNode} model Model to observe
* @param {Object} [config] Configuration options
*/
ve.ce.MWReferenceNode = function VeCeMWReferenceNode( model, config ) {
ve.ce.MWReferenceNode = function VeCeMWReferenceNode() {
// Parent constructor
ve.ce.LeafNode.call( this, model, config );
ve.ce.MWReferenceNode.super.apply( this, arguments );
// Mixin constructors
ve.ce.FocusableNode.call( this );

View file

@ -16,9 +16,9 @@
* @param {ve.dm.MWReferencesListNode} model Model to observe
* @param {Object} [config] Configuration options
*/
ve.ce.MWReferencesListNode = function VeCeMWReferencesListNode( model, config ) {
ve.ce.MWReferencesListNode = function VeCeMWReferencesListNode() {
// Parent constructor
ve.ce.LeafNode.call( this, model, config );
ve.ce.MWReferencesListNode.super.apply( this, arguments );
// Mixin constructors
ve.ce.FocusableNode.call( this );
@ -78,7 +78,7 @@ ve.ce.MWReferencesListNode.prototype.onSetup = function () {
this.listNode.connect( this, { update: 'onListNodeUpdate' } );
// Parent method
ve.ce.LeafNode.prototype.onSetup.call( this );
ve.ce.MWReferencesListNode.super.prototype.onSetup.call( this );
};
/**
@ -94,7 +94,7 @@ ve.ce.MWReferencesListNode.prototype.onTeardown = function () {
this.listNode = null;
// Parent method
ve.ce.LeafNode.prototype.onTeardown.call( this );
ve.ce.MWReferencesListNode.super.prototype.onTeardown.call( this );
};
/**

View file

@ -17,7 +17,7 @@
*/
ve.dm.MWReferenceNode = function VeDmMWReferenceNode() {
// Parent constructor
ve.dm.LeafNode.apply( this, arguments );
ve.dm.MWReferenceNode.super.apply( this, arguments );
// Mixin constructors
ve.dm.FocusableNode.call( this );

View file

@ -18,7 +18,7 @@
*/
ve.dm.MWReferencesListNode = function VeDmMWReferencesListNode() {
// Parent constructor
ve.dm.BranchNode.apply( this, arguments );
ve.dm.MWReferencesListNode.super.apply( this, arguments );
// Mixin constructors
ve.dm.FocusableNode.call( this );

View file

@ -14,9 +14,9 @@
* @constructor
* @param {ve.ui.Surface} surface Surface to act on
*/
ve.ui.MWCitationAction = function VeUiMWCitationAction( surface ) {
ve.ui.MWCitationAction = function VeUiMWCitationAction() {
// Parent constructor
ve.ui.Action.call( this, surface );
ve.ui.MWCitationAction.super.apply( this, arguments );
};
/* Inheritance */

View file

@ -104,8 +104,8 @@
// Generate citation tool
name = 'cite-' + item.name;
if ( !ve.ui.toolFactory.lookup( name ) ) {
tool = function GeneratedMWCitationDialogTool( toolbar, config ) {
ve.ui.MWCitationDialogTool.call( this, toolbar, config );
tool = function GeneratedMWCitationDialogTool() {
ve.ui.MWCitationDialogTool.apply( this, arguments );
};
OO.inheritClass( tool, ve.ui.MWCitationDialogTool );
tool.static.group = 'cite';
@ -131,8 +131,9 @@
// Generate citation context item
if ( !ve.ui.contextItemFactory.lookup( name ) ) {
contextItem = function GeneratedMWCitationContextItem( toolbar, config ) {
ve.ui.MWCitationContextItem.call( this, toolbar, config );
contextItem = function GeneratedMWCitationContextItem() {
// Parent constructor
ve.ui.MWCitationContextItem.apply( this, arguments );
};
OO.inheritClass( contextItem, ve.ui.MWCitationContextItem );
contextItem.static.name = name;
@ -145,8 +146,8 @@
// Generate dialog
if ( !ve.ui.windowFactory.lookup( name ) ) {
dialog = function GeneratedMWCitationDialog( config ) {
ve.ui.MWCitationDialog.call( this, config );
dialog = function GeneratedMWCitationDialog() {
ve.ui.MWCitationDialog.apply( this, arguments );
};
OO.inheritClass( dialog, ve.ui.MWCitationDialog );
dialog.static.name = name;

View file

@ -21,7 +21,7 @@ ve.ui.MWReferenceGroupInputWidget = function VeUiMWReferenceGroupInputWidget( co
this.emptyGroupName = config.emptyGroupName;
// Parent constructor
OO.ui.ComboBoxWidget.call( this, $.extend( true, { input: { placeholder: config.emptyGroupName } }, config ) );
ve.ui.MWReferenceGroupInputWidget.super.call( this, $.extend( true, { input: { placeholder: config.emptyGroupName } }, config ) );
this.$element.addClass( 've-ui-mwReferenceGroupInputWidget' );
};

View file

@ -21,7 +21,7 @@ ve.ui.MWReferenceSearchWidget = function VeUiMWReferenceSearchWidget( config ) {
}, config );
// Parent constructor
OO.ui.SearchWidget.call( this, config );
ve.ui.MWReferenceSearchWidget.super.call( this, config );
// Properties
this.index = [];
@ -46,7 +46,7 @@ OO.inheritClass( ve.ui.MWReferenceSearchWidget, OO.ui.SearchWidget );
*/
ve.ui.MWReferenceSearchWidget.prototype.onQueryChange = function () {
// Parent method
OO.ui.SearchWidget.prototype.onQueryChange.call( this );
ve.ui.MWReferenceSearchWidget.super.prototype.onQueryChange.call( this );
// Populate
this.addResults();