diff --git a/src/resizable.directive.ts b/src/resizable.directive.ts index b980cdd..443fa79 100644 --- a/src/resizable.directive.ts +++ b/src/resizable.directive.ts @@ -203,6 +203,13 @@ const RESIZE_GHOST_ELEMENT_CLASS: string = 'resize-ghost-element'; export const MOUSE_MOVE_THROTTLE_MS: number = 50; +let currentResize: { + edges: Edges, + startingRect: BoundingRectangle, + currentRect: BoundingRectangle, + clonedNode?: HTMLElement +}; + /** * Place this on an element to make it resizable * @@ -322,13 +329,6 @@ export class Resizable implements OnInit, OnDestroy, AfterViewInit { this.mouseup.next({clientX, clientY}); }); - let currentResize: { - edges: Edges, - startingRect: BoundingRectangle, - currentRect: BoundingRectangle, - clonedNode?: HTMLElement - }; - const removeGhostElement: Function = (): void => { if (currentResize.clonedNode) { this.elm.nativeElement.parentElement.removeChild(currentResize.clonedNode);