| 1 | /*! |
| 2 | * VisualEditor user interface MWGalleryGroupWidget class. |
| 3 | * |
| 4 | * @copyright See AUTHORS.txt |
| 5 | * @license The MIT License (MIT); see LICENSE.txt |
| 6 | */ |
| 7 | |
| 8 | /** |
| 9 | * Draggable group widget for reordering images in the MWGalleryDialog. |
| 10 | * |
| 11 | * @class |
| 12 | * @extends OO.ui.Widget |
| 13 | * @mixes OO.ui.mixin.DraggableGroupElement |
| 14 | * |
| 15 | * @constructor |
| 16 | * @param {Object} [config] Configuration options |
| 17 | * @param {string} [config.orientation='vertical'] |
| 18 | */ |
| 19 | ve.ui.MWGalleryGroupWidget = function VeUiMWGalleryGroupWidget( config ) { |
| 20 | // Configuration initialization |
| 21 | config = config || {}; |
| 22 | |
| 23 | // Parent constructor |
| 24 | ve.ui.MWGalleryGroupWidget.super.apply( this, arguments ); |
| 25 | |
| 26 | // Mixin constructors |
| 27 | OO.ui.mixin.DraggableGroupElement.call( this, ve.extendObject( {}, config, { $group: this.$element } ) ); |
| 28 | |
| 29 | // Events |
| 30 | this.aggregate( { |
| 31 | edit: 'editItem' |
| 32 | } ); |
| 33 | }; |
| 34 | |
| 35 | /* Inheritance */ |
| 36 | |
| 37 | OO.inheritClass( ve.ui.MWGalleryGroupWidget, OO.ui.Widget ); |
| 38 | |
| 39 | OO.mixinClass( ve.ui.MWGalleryGroupWidget, OO.ui.mixin.DraggableGroupElement ); |
| 40 | |
| 41 | /* Events */ |
| 42 | |
| 43 | /** |
| 44 | * @event ve.ui.MWGalleryGroupWidget#editItem |
| 45 | */ |