diff --git a/modules/ve/ce/ve.ce.Surface.js b/modules/ve/ce/ve.ce.Surface.js index c5197c0b1c..baa8468193 100644 --- a/modules/ve/ce/ve.ce.Surface.js +++ b/modules/ve/ce/ve.ce.Surface.js @@ -1079,20 +1079,6 @@ ve.ce.Surface.prototype.getOffsetFromElementNode = function( domNode, domOffset, } }; -ve.ce.Surface.prototype.updateContextIcon = function() { - var _this = this, - selection = this.model.getSelection(); - - if ( this.contextView ) { - if ( selection.getLength() > 0 ) { - this.contextView.set(); - } else { - this.contextView.clear(); - } - } - -}; - /* Supplies the selection anchor coordinates to contextView */ ve.ce.Surface.prototype.getSelectionRect = function() { var rangySel = rangy.getSelection(); diff --git a/modules/ve/ui/ve.ui.Context.js b/modules/ve/ui/ve.ui.Context.js index 379b588c43..3228e9e511 100644 --- a/modules/ve/ui/ve.ui.Context.js +++ b/modules/ve/ui/ve.ui.Context.js @@ -102,11 +102,13 @@ ve.ui.Context.prototype.isMenuOpen = function() { }; ve.ui.Context.prototype.set = function() { - this.positionIcon(); - if ( this.position ) { - this.positionOverlay( this.menuView.$ ); - if ( this.inspector ) { - this.positionOverlay ( this.$inspectors ); + if ( this.surfaceView.getModel().getSelection().getLength() > 0 ) { + this.positionIcon(); + if ( this.position ) { + this.positionOverlay( this.menuView.$ ); + if ( this.inspector ) { + this.positionOverlay ( this.$inspectors ); + } } } };