mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 11:16:51 +00:00
Merge "Display overlay phantoms for inline blocks (no need to use shields)."
This commit is contained in:
commit
e808e67a64
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue