mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-01 09:26:37 +00:00
Merge "Recalculate $resizable offset when positioning resize label"
This commit is contained in:
commit
a2587ce927
|
@ -82,21 +82,24 @@ ve.ce.ResizableNode.prototype.updateSizeLabel = function ( dimensions ) {
|
||||||
if ( !this.$sizeLabel ) {
|
if ( !this.$sizeLabel ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var node, top, height;
|
var offset, node, top, height;
|
||||||
if ( dimensions ) {
|
if ( dimensions ) {
|
||||||
|
offset = ve.Element.getRelativePosition(
|
||||||
|
this.$resizable, this.getRoot().getSurface().getSurface().$
|
||||||
|
);
|
||||||
// Things get a bit tight below 100px, so put the label on the outside
|
// Things get a bit tight below 100px, so put the label on the outside
|
||||||
if ( dimensions.width < 100 ) {
|
if ( dimensions.width < 100 ) {
|
||||||
top = dimensions.top + dimensions.height;
|
top = offset.top + dimensions.height;
|
||||||
height = 30;
|
height = 30;
|
||||||
} else {
|
} else {
|
||||||
top = dimensions.top;
|
top = offset.top;
|
||||||
height = dimensions.height;
|
height = dimensions.height;
|
||||||
}
|
}
|
||||||
this.$sizeLabel
|
this.$sizeLabel
|
||||||
.addClass( 've-ce-resizableNode-sizeLabel-resizing' )
|
.addClass( 've-ce-resizableNode-sizeLabel-resizing' )
|
||||||
.css( {
|
.css( {
|
||||||
'top': top,
|
'top': top,
|
||||||
'left': dimensions.left,
|
'left': offset.left,
|
||||||
'width': dimensions.width,
|
'width': dimensions.width,
|
||||||
'height': height,
|
'height': height,
|
||||||
'lineHeight': height + 'px'
|
'lineHeight': height + 'px'
|
||||||
|
|
Loading…
Reference in a new issue