Merge "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."

This commit is contained in:
Catrope 2012-07-07 15:49:45 +00:00 committed by Gerrit Code Review
commit d8fa2dfbee
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 );
}
}
}
};