mediawiki-extensions-Visual.../modules/ve-mw/ce/nodes/ve.ce.MWGalleryNode.js
Ed Sanders 15bbcc6d63 Remove display:inline-block highlight hacks
With getClientRects these are no longer necessary.

Depends on I09f1c0850 in core.

Bug: 51708
Change-Id: I7e6c6528f4dd23aee7fa61ecb38eb658e11a8356
2014-06-16 11:52:37 +01:00

52 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*!
* VisualEditor ContentEditable MWGalleryNode class.
*
* @copyright 20112014 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 );