mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 11:16:51 +00:00
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:
parent
970873595b
commit
b71586f296
|
@ -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();
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue