Merge "Display overlay phantoms for inline blocks (no need to use shields)."

This commit is contained in:
Trevor Parscal 2012-11-15 00:11:21 +00:00 committed by Gerrit Code Review
commit e808e67a64

View file

@ -23,6 +23,7 @@ ve.ce.AlienInlineNode = function VeCeAlienInlineNode( model ) {
// Events
this.model.addListenerMethod( this, 'update', 'onUpdate' );
this.$.on( 'mouseenter', ve.bind( this.onMouseEnter, this ) );
// Initialization
this.onUpdate();
@ -51,6 +52,18 @@ ve.ce.AlienInlineNode.prototype.onUpdate = function () {
this.$.html( this.model.getAttribute( 'html' ) );
};
ve.ce.AlienInlineNode.prototype.onMouseEnter = function () {
var $phantom = ve.ce.Surface.static.$phantomTemplate.clone(),
offset = this.$.offset();
$phantom.css( {
'top': offset.top,
'left': offset.left,
'height': this.$.height(),
'width': this.$.width()
} );
this.root.getSurface().$phantoms.empty().append( $phantom );
};
/* Registration */
ve.ce.nodeFactory.register( 'alienInline', ve.ce.AlienInlineNode );