From 5b48d7f1e83122002d00b9da656b10495619ba1f Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Wed, 31 Jul 2013 22:16:24 +0200 Subject: [PATCH] ce.ProtectedNode: Use surface initialize event instead of toolbarPosition Follows-up 867ec44a9. Because: - #toolbarPosition is emitted more than once (so this should at least have been a once() bind, not a connect) - It is emitted for more than 1 toolbar (includes context menu toolbar) - Semantically incorrect (we want to know when the surface changes not the toolbar) - We want to get rid of that event entirely and this is the last use of it. Change-Id: Ica5ed04052f48fe84607abab72bcf65f97d689ed --- modules/ve/ce/ve.ce.ProtectedNode.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ve/ce/ve.ce.ProtectedNode.js b/modules/ve/ce/ve.ce.ProtectedNode.js index 329b5bff73..3a12f539c0 100644 --- a/modules/ve/ce/ve.ce.ProtectedNode.js +++ b/modules/ve/ce/ve.ce.ProtectedNode.js @@ -79,7 +79,7 @@ ve.ce.ProtectedNode.prototype.onProtectedSetup = function () { this.getRoot().getSurface().getModel() .connect( this, { 'change': 'onSurfaceModelChange' } ); this.getRoot().getSurface().getSurface() - .connect( this, { 'toolbarPosition': 'positionPhantoms' } ); + .connect( this, { 'position': 'positionPhantoms' } ); // Shields this.$.add( this.$.find( '*' ) ).each( function () { @@ -115,7 +115,7 @@ ve.ce.ProtectedNode.prototype.onProtectedTeardown = function () { this.root.getSurface().getModel() .disconnect( this, { 'change': 'onSurfaceModelChange' } ); this.getRoot().getSurface().getSurface() - .disconnect( this, { 'toolbarPosition': 'positionPhantoms' } ); + .disconnect( this, { 'position': 'positionPhantoms' } ); // Shields this.$shields.remove();