Bug 37811 - VisualEditor: editing toolbar float trigger also triggers contextView icon, although there is no context to act on

-Remove unused updateContext method.
-Added check for selection length in contextView set method.

Change-Id: I1d5791c69deea80c54cff3e021ba4c90cdac2cc4
This commit is contained in:
Rob Moen 2012-07-02 12:48:09 -07:00 committed by Catrope
parent 970873595b
commit b71586f296
2 changed files with 7 additions and 19 deletions

View file

@ -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();

View file

@ -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 );
}
}
}
};