From 0d15980638af3fdebd728bef9cf3181415b1c927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Inez=20Korczyn=CC=81ski?= Date: Wed, 14 Nov 2012 13:43:03 -0800 Subject: [PATCH] Display overlay phantoms for inline blocks (no need to use shields). Change-Id: Ife362035c43daf863a3b6a5f892dc928d1f6ec80 --- modules/ve/ce/nodes/ve.ce.AlienInlineNode.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/ve/ce/nodes/ve.ce.AlienInlineNode.js b/modules/ve/ce/nodes/ve.ce.AlienInlineNode.js index 296ebd6961..c682ea494e 100644 --- a/modules/ve/ce/nodes/ve.ce.AlienInlineNode.js +++ b/modules/ve/ce/nodes/ve.ce.AlienInlineNode.js @@ -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 );