From b0ab2151d8024afc1a42ee8a22473c4372630060 Mon Sep 17 00:00:00 2001 From: Nikolay Bersenev Date: Fri, 27 Oct 2017 15:39:47 +0300 Subject: [PATCH] fix: double creation --- src/resizable.directive.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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);