mediawiki-extensions-Math/modules/ve-math/ve.dm.MWMathNode.js
Ed Sanders 905a834be2 VE: Move hash changes to the rendering hash
Depends on I5d42943a0 in VE core.

Bug: T114689
Change-Id: Ib64a1184132fbf62f38c6bd5dde689acff7b8ae5
2015-10-07 14:40:43 +00:00

55 lines
1.2 KiB
JavaScript

/*!
* VisualEditor DataModel MWMathNode class.
*
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/*global ve, OO */
/**
* DataModel MediaWiki math node.
*
* @class
* @extends ve.dm.MWInlineExtensionNode
*
* @constructor
* @param {Object} [element]
*/
ve.dm.MWMathNode = function VeDmMWMathNode() {
// Parent constructor
ve.dm.MWMathNode.super.apply( this, arguments );
};
/* Inheritance */
OO.inheritClass( ve.dm.MWMathNode, ve.dm.MWInlineExtensionNode );
/* Static members */
ve.dm.MWMathNode.static.name = 'mwMath';
ve.dm.MWMathNode.static.tagName = 'img';
ve.dm.MWMathNode.static.extensionName = 'math';
/* Static Methods */
/**
* @inheritdoc ve.dm.GeneratedContentNode
*/
ve.dm.MWMathNode.static.getHashObjectForRendering = function ( dataElement ) {
// Parent method
var hashObject = ve.dm.MWMathNode.super.static.getHashObjectForRendering.call( this, dataElement );
// The id does not affect the rendering.
if ( hashObject.mw.attrs ) {
delete hashObject.mw.attrs.id;
}
return hashObject;
};
/* Registration */
ve.dm.modelRegistry.register( ve.dm.MWMathNode );