mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-21 18:43:25 +00:00
aa556e3ef8
I tried to review all of them. Some of the changes I did: * Make sure the `config` parameter is not marked as optional when it is not. * Make sure default values are mentioned. * List individual `@cfg` options when it makes sense. Note I don't list all options a class could accept (e.g. via all its parent classes and mixins). That's too much. Instead I checked how a class is actually used and list only these options. Even then I don't list everything, e.g. unspecific options like "classes" that can be used pretty much everywhere. Change-Id: Idf4fbe1dc3608ace277df9e385f2f140df3a2f50
46 lines
1 KiB
JavaScript
46 lines
1 KiB
JavaScript
/*!
|
|
* VisualEditor user interface MWGalleryGroupWidget class.
|
|
*
|
|
* @copyright 2011-2020 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* Draggable group widget for reordering images in the MWGalleryDialog.
|
|
*
|
|
* @class
|
|
* @extends OO.ui.Widget
|
|
* @mixins OO.ui.mixin.DraggableGroupElement
|
|
*
|
|
* @constructor
|
|
* @param {Object} [config] Configuration options
|
|
* @cfg {string} [orientation='vertical']
|
|
*/
|
|
ve.ui.MWGalleryGroupWidget = function VeUiMWGalleryGroupWidget( config ) {
|
|
// Configuration initialization
|
|
config = config || {};
|
|
|
|
// Parent constructor
|
|
ve.ui.MWGalleryGroupWidget.super.apply( this, arguments );
|
|
|
|
// Mixin constructors
|
|
OO.ui.mixin.DraggableGroupElement.call( this, $.extend( {}, config, { $group: this.$element } ) );
|
|
|
|
// Events
|
|
this.aggregate( {
|
|
edit: 'editItem'
|
|
} );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
OO.inheritClass( ve.ui.MWGalleryGroupWidget, OO.ui.Widget );
|
|
|
|
OO.mixinClass( ve.ui.MWGalleryGroupWidget, OO.ui.mixin.DraggableGroupElement );
|
|
|
|
/* Events */
|
|
|
|
/**
|
|
* @event editItem
|
|
*/
|