mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
15bbcc6d63
With getClientRects these are no longer necessary. Depends on I09f1c0850 in core. Bug: 51708 Change-Id: I7e6c6528f4dd23aee7fa61ecb38eb658e11a8356
52 lines
1.2 KiB
JavaScript
52 lines
1.2 KiB
JavaScript
/*!
|
||
* VisualEditor ContentEditable MWGalleryNode class.
|
||
*
|
||
* @copyright 2011–2014 VisualEditor Team and others; see AUTHORS.txt
|
||
* @license The MIT License (MIT); see LICENSE.txt
|
||
*/
|
||
|
||
/**
|
||
* ContentEditable MediaWiki gallery node.
|
||
*
|
||
* @class
|
||
* @extends ve.ce.MWBlockExtensionNode
|
||
*
|
||
* @constructor
|
||
* @param {ve.dm.MWGalleryNode} model Model to observe
|
||
* @param {Object} [config] Configuration options
|
||
*/
|
||
ve.ce.MWGalleryNode = function VeCeMWGalleryNode( model, config ) {
|
||
// Parent constructor
|
||
ve.ce.MWBlockExtensionNode.call( this, model, config );
|
||
|
||
// DOM changes
|
||
this.$element.addClass( 've-ce-mwGalleryNode' );
|
||
};
|
||
|
||
/* Inheritance */
|
||
|
||
OO.inheritClass( ve.ce.MWGalleryNode, ve.ce.MWBlockExtensionNode );
|
||
|
||
/* Static Properties */
|
||
|
||
ve.ce.MWGalleryNode.static.name = 'mwGallery';
|
||
|
||
ve.ce.MWGalleryNode.static.tagName = 'div';
|
||
|
||
ve.ce.MWGalleryNode.static.primaryCommandName = 'gallery';
|
||
|
||
/* Methods */
|
||
|
||
/**
|
||
* @inheritdoc
|
||
*/
|
||
ve.ce.MWGalleryNode.prototype.onSetup = function () {
|
||
ve.ce.MWGalleryNode.super.prototype.onSetup.apply( this, arguments );
|
||
// The ul.gallery is 100% width, so don't give it a highlight
|
||
this.$element.find( '.gallery' ).addClass( 've-ce-noHighlight' );
|
||
};
|
||
|
||
/* Registration */
|
||
|
||
ve.ce.nodeFactory.register( ve.ce.MWGalleryNode );
|