mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 14:33:59 +00:00
Merge "Make MWBlockImageNode a ProtectedNode (by adding mixin)."
This commit is contained in:
commit
3bed4284dd
|
@ -10,6 +10,8 @@
|
||||||
*
|
*
|
||||||
* @class
|
* @class
|
||||||
* @extends ve.ce.BranchNode
|
* @extends ve.ce.BranchNode
|
||||||
|
* @mixins ve.ce.ProtectedNode
|
||||||
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @param {ve.dm.MWBlockImageNode} model Model to observe
|
* @param {ve.dm.MWBlockImageNode} model Model to observe
|
||||||
* @param {Object} [config] Config options
|
* @param {Object} [config] Config options
|
||||||
|
@ -18,6 +20,9 @@ ve.ce.MWBlockImageNode = function VeCeMWBlockImageNode( model, config ) {
|
||||||
// Parent constructor
|
// Parent constructor
|
||||||
ve.ce.BranchNode.call( this, model, config );
|
ve.ce.BranchNode.call( this, model, config );
|
||||||
|
|
||||||
|
// Mixin constructors
|
||||||
|
ve.ce.ProtectedNode.call( this );
|
||||||
|
|
||||||
if ( this.model.getAttribute( 'align' ) === 'center' ) {
|
if ( this.model.getAttribute( 'align' ) === 'center' ) {
|
||||||
this.$.addClass( 'center' );
|
this.$.addClass( 'center' );
|
||||||
this.$thumb = this.$$( '<div>' ).appendTo( this.$ );
|
this.$thumb = this.$$( '<div>' ).appendTo( this.$ );
|
||||||
|
@ -48,6 +53,8 @@ ve.ce.MWBlockImageNode = function VeCeMWBlockImageNode( model, config ) {
|
||||||
|
|
||||||
ve.inheritClass( ve.ce.MWBlockImageNode, ve.ce.BranchNode );
|
ve.inheritClass( ve.ce.MWBlockImageNode, ve.ce.BranchNode );
|
||||||
|
|
||||||
|
ve.mixinClass( ve.ce.MWBlockImageNode, ve.ce.ProtectedNode );
|
||||||
|
|
||||||
/* Static Properties */
|
/* Static Properties */
|
||||||
|
|
||||||
ve.ce.MWBlockImageNode.static.name = 'MWblockimage';
|
ve.ce.MWBlockImageNode.static.name = 'MWblockimage';
|
||||||
|
|
Loading…
Reference in a new issue