jenkins-bot has submitted this change and it was merged. Change subject: Fixups to ToolbarViewController.js ......................................................................
Fixups to ToolbarViewController.js Change-Id: I4f32404c43ec11c554e22b954d8bddd6c815ced4 --- M view/resources/wikibase/view/ToolbarViewController.js 1 file changed, 18 insertions(+), 9 deletions(-) Approvals: Hoo man: Looks good to me, approved jenkins-bot: Verified diff --git a/view/resources/wikibase/view/ToolbarViewController.js b/view/resources/wikibase/view/ToolbarViewController.js index 5993c01..9501557 100644 --- a/view/resources/wikibase/view/ToolbarViewController.js +++ b/view/resources/wikibase/view/ToolbarViewController.js @@ -19,6 +19,7 @@ * returning a Promise. * @param {jQuery.wikibase.edittoolbar} toolbar * @param {jQuery.ui.EditableTemplatedWidget} view + * @param {Function} removeView */ var SELF = util.inherit( wb.view.ViewController, @@ -54,18 +55,24 @@ */ SELF.prototype._view = null; +/** + * @property {Function} + * @private + */ +SELF.prototype._removeView = null; + +/** + * @param {Object|null} value A wikibase.datamodel object supporting at least an equals method. + */ SELF.prototype.setValue = function( value ) { this._value = value; // When option is set, remove icon is shown. Not really needed on every setValue(). this._toolbar.option( 'onRemove', - ( value && this._model.remove ) ? $.proxy( this, 'remove' ) : null + ( value && this._model.remove ) ? $.proxy( this.remove, this ) : null ); }; -/** - * Start editing - */ SELF.prototype.startEditing = function() { var result = this._view.startEditing(); this._toolbar.toEditMode(); @@ -73,11 +80,11 @@ this._updateSaveButtonState(); this._view.element.on( this._view.widgetEventPrefix + 'change', - jQuery.proxy( this._updateSaveButtonState, this ) + $.proxy( this._updateSaveButtonState, this ) ); this._view.element.on( this._view.widgetEventPrefix + 'disable', - jQuery.proxy( this._updateToolbarState, this ) + $.proxy( this._updateToolbarState, this ) ); return result; }; @@ -104,8 +111,6 @@ }; /** - * Stop editing - * * @param {boolean} [dropValue=false] Whether the current value should be kept and * persisted or dropped */ @@ -168,6 +173,10 @@ } ); }; +/** + * @param {boolean} [dropValue=false] Whether the current value should be kept and + * persisted or dropped + */ SELF.prototype._leaveEditMode = function( dropValue ) { if ( dropValue && !this._value ) { this._removeView(); @@ -194,7 +203,7 @@ /** * Set or clear error * - * @param {mixed} [error] The error or undefined, if error should be + * @param {wikibase.api.RepoApiError} [error] The error or undefined, if error should be * cleared */ SELF.prototype.setError = function( error ) { -- To view, visit https://gerrit.wikimedia.org/r/302436 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4f32404c43ec11c554e22b954d8bddd6c815ced4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de> Gerrit-Reviewer: Hoo man <h...@online.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits