Esanders has uploaded a new change for review. https://gerrit.wikimedia.org/r/89812
Change subject: Split out setResizableHandlesPosition in ResizableNode ...................................................................... Split out setResizableHandlesPosition in ResizableNode Change-Id: I254fc1851abdc7477e2067d1a6b5406f286e8668 --- M modules/ve/ce/ve.ce.ResizableNode.js 1 file changed, 25 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/12/89812/1 diff --git a/modules/ve/ce/ve.ce.ResizableNode.js b/modules/ve/ce/ve.ce.ResizableNode.js index f33bf93..3339730 100644 --- a/modules/ve/ce/ve.ce.ResizableNode.js +++ b/modules/ve/ce/ve.ce.ResizableNode.js @@ -170,31 +170,46 @@ * @method */ ve.ce.ResizableNode.prototype.setResizableHandlesSizeAndPosition = function () { - var offset = ve.Element.getRelativePosition( - this.$resizable, this.getRoot().getSurface().getSurface().$ - ); + var width = this.$resizable.width(), + height = this.$resizable.height(); + + this.setResizableHandlesPosition(); this.$resizeHandles .css( { 'width': 0, - 'height': 0, - 'top': offset.top, - 'left': offset.left + 'height': 0 } ) .find( '.ve-ce-resizableNode-neHandle' ) - .css( { 'margin-right': -this.$resizable.width() } ) + .css( { 'margin-right': -width } ) .end() .find( '.ve-ce-resizableNode-swHandle' ) - .css( { 'margin-bottom': -this.$resizable.height() } ) + .css( { 'margin-bottom': -height } ) .end() .find( '.ve-ce-resizableNode-seHandle' ) .css( { - 'margin-right': -this.$resizable.width(), - 'margin-bottom': -this.$resizable.height() + 'margin-right': -width, + 'margin-bottom': -height } ); }; /** + * Set the proper position for resize handles + * + * @method + */ +ve.ce.ResizableNode.prototype.setResizableHandlesPosition = function () { + var offset = ve.Element.getRelativePosition( + this.$resizable, this.getRoot().getSurface().getSurface().$ + ); + + this.$resizeHandles.css( { + 'top': offset.top, + 'left': offset.left + } ); +}; + +/** * Handle body mousemove. * * @method -- To view, visit https://gerrit.wikimedia.org/r/89812 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I254fc1851abdc7477e2067d1a6b5406f286e8668 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Esanders <esand...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits