mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
Reposition phantoms on init
When the toolbar animates, the position of the surface changes. ProtectedNode now listens for the toolbarPosition event and repositions the phantoms. I also tried moving the localOverlay to be a sibling of the surface (instead of child of body), but the same problems persisted. Bug: 49853 Change-Id: I8ae1c8f66c6083b4ffee7107a78a298126e1064c
This commit is contained in:
parent
d31918d145
commit
867ec44a9f
|
@ -65,7 +65,7 @@ ve.ce.ProtectedNode.static.$phantomTemplate = $( '<div>' )
|
|||
* @method
|
||||
*/
|
||||
ve.ce.ProtectedNode.prototype.onProtectedSetup = function () {
|
||||
var $shield, surfaceModel,
|
||||
var $shield, surfaceModel, surface,
|
||||
node = this,
|
||||
$shieldTemplate = this.constructor.static.$shieldTemplate;
|
||||
|
||||
|
@ -75,10 +75,12 @@ ve.ce.ProtectedNode.prototype.onProtectedSetup = function () {
|
|||
this.isSetup = true;
|
||||
|
||||
surfaceModel = this.getRoot().getSurface().getModel();
|
||||
surface = this.getRoot().getSurface().getSurface();
|
||||
|
||||
// Events
|
||||
this.$.on( 'mouseenter.ve-ce-protectedNode', ve.bind( this.onProtectedMouseEnter, this ) );
|
||||
surfaceModel.connect( this, { 'change': 'onSurfaceModelChange' } );
|
||||
surface.connect( this, { 'toolbarPosition': 'positionPhantoms' } );
|
||||
|
||||
// Shields
|
||||
this.$.add( this.$.find( '*' ) ).each( function () {
|
||||
|
|
Loading…
Reference in a new issue