Bmansurov has uploaded a new change for review.
https://gerrit.wikimedia.org/r/207010
Change subject: Hygiene: Remove the 'options' argument from preRender and
postRender functions
......................................................................
Hygiene: Remove the 'options' argument from preRender and postRender functions
Depends on If8fc6b5223868ffd180b08ec931f6ca82e2223d5
Change-Id: I739fc54f7a441474186bc3f79c9941b2dcfedb46
---
M resources/ext.gather.collection.editor/CollectionEditOverlay.js
M resources/ext.gather.page.search/CollectionPageList.js
M resources/ext.gather.page.search/CollectionSearchPanel.js
M resources/ext.gather.watchstar/CollectionsContentOverlay.js
M resources/ext.gather.watchstar/CollectionsWatchstar.js
5 files changed, 12 insertions(+), 13 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Gather
refs/changes/10/207010/1
diff --git a/resources/ext.gather.collection.editor/CollectionEditOverlay.js
b/resources/ext.gather.collection.editor/CollectionEditOverlay.js
index a38a26a..aab72f0 100644
--- a/resources/ext.gather.collection.editor/CollectionEditOverlay.js
+++ b/resources/ext.gather.collection.editor/CollectionEditOverlay.js
@@ -87,14 +87,14 @@
this.$clear = this.$( '.search-header .clear' );
},
/** @inheritdoc */
- postRender: function ( options ) {
+ postRender: function () {
var self = this,
id = this.id;
- Overlay.prototype.postRender.apply( this, arguments );
+ Overlay.prototype.postRender.apply( this );
this.api.getCollectionMembers( id ).done( function (
pages ) {
self.searchPanel = new CollectionSearchPanel( {
- collection: options.collection,
+ collection: self.options.collection,
pages: pages,
el: self.$( '.panel' )
} );
diff --git a/resources/ext.gather.page.search/CollectionPageList.js
b/resources/ext.gather.page.search/CollectionPageList.js
index f7f36a3..4da65fe 100644
--- a/resources/ext.gather.page.search/CollectionPageList.js
+++ b/resources/ext.gather.page.search/CollectionPageList.js
@@ -55,7 +55,6 @@
*/
postRender: function () {
// FIXME: PageList in MobileFrontend should be
rewritten as PageListWatchstar.
- View.prototype.postRender.apply( this, arguments );
},
/**
* Event handler for when a member changes status in the
collection
diff --git a/resources/ext.gather.page.search/CollectionSearchPanel.js
b/resources/ext.gather.page.search/CollectionSearchPanel.js
index 130a649..d0ec192 100644
--- a/resources/ext.gather.page.search/CollectionSearchPanel.js
+++ b/resources/ext.gather.page.search/CollectionSearchPanel.js
@@ -43,14 +43,14 @@
this.api = new SearchApi();
Panel.prototype.initialize.call( this, options );
this._members = {};
- $.each( options.pages, function ( i, page ) {
+ $.each( this.options.pages, function ( i, page ) {
self._members[page.title] = true;
} );
},
/** @inheritdoc */
- postRender: function ( options ) {
- Panel.prototype.postRender.apply( this, arguments );
- this._renderResults( options.pages );
+ postRender: function () {
+ Panel.prototype.postRender.apply( this );
+ this._renderResults( this.options.pages );
},
/**
* Updates the members of the collection associated with the
panel
diff --git a/resources/ext.gather.watchstar/CollectionsContentOverlay.js
b/resources/ext.gather.watchstar/CollectionsContentOverlay.js
index 7f05eff..072ce63 100644
--- a/resources/ext.gather.watchstar/CollectionsContentOverlay.js
+++ b/resources/ext.gather.watchstar/CollectionsContentOverlay.js
@@ -102,7 +102,7 @@
} );
$form.append( this.createButton.$element );
-
CollectionsContentOverlayBase.prototype.postRender.apply( this, arguments );
+
CollectionsContentOverlayBase.prototype.postRender.apply( this );
this.expandForm();
},
/**
diff --git a/resources/ext.gather.watchstar/CollectionsWatchstar.js
b/resources/ext.gather.watchstar/CollectionsWatchstar.js
index 3bdf297..0bd9984 100644
--- a/resources/ext.gather.watchstar/CollectionsWatchstar.js
+++ b/resources/ext.gather.watchstar/CollectionsWatchstar.js
@@ -64,15 +64,15 @@
collections: undefined
},
/** @inheritdoc */
- preRender: function ( options ) {
- options.watchIconClass = options.isWatched ?
watchedIcon.getClassName() :
+ preRender: function () {
+ this.options.watchIconClass = this.options.isWatched ?
watchedIcon.getClassName() :
watchIcon.getClassName();
},
/** @inheritdoc */
- postRender: function ( options ) {
+ postRender: function () {
var $el = this.$el;
// For newly authenticated users via CTA force dialog
to open.
- if ( options.isNewlyAuthenticatedUser ) {
+ if ( this.options.isNewlyAuthenticatedUser ) {
setTimeout( function () {
$el.trigger( 'click' );
}, 500 );
--
To view, visit https://gerrit.wikimedia.org/r/207010
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I739fc54f7a441474186bc3f79c9941b2dcfedb46
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Bmansurov <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits