From ba9e72ed8b0d1cea08ce206b5cbd71bc6cdaab74 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Tue, 20 Feb 2018 14:26:46 -0500 Subject: [PATCH] NIFI-3502: - Preventing digest() during an ongoing apply() or digest() lifecycle. This closes #2471 Signed-off-by: Scott Aslan --- .../nf-ng-canvas-navigate-controller.js | 18 +++++++++++++----- .../webapp/js/nf/canvas/nf-canvas-bootstrap.js | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-navigate-controller.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-navigate-controller.js index 4eb27a5069..6f1430f3b9 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-navigate-controller.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-navigate-controller.js @@ -35,7 +35,7 @@ }(this, function (nfCanvasUtils, nfContextMenu) { 'use strict'; - return function () { + return function ($timeout) { 'use strict'; function NavigateCtrl() { @@ -44,28 +44,36 @@ * Zoom in on the canvas. */ this.zoomIn = function () { - nfCanvasUtils.zoomInCanvas(); + $timeout(function () { + nfCanvasUtils.zoomInCanvas(); + }, 0); }; /** * Zoom out on the canvas. */ this.zoomOut = function () { - nfCanvasUtils.zoomOutCanvas(); + $timeout(function () { + nfCanvasUtils.zoomOutCanvas(); + }, 0); }; /** * Zoom fit on the canvas. */ this.zoomFit = function () { - nfCanvasUtils.fitCanvas(); + $timeout(function () { + nfCanvasUtils.fitCanvas(); + }, 0); }; /** * Zoom actual size on the canvas. */ this.zoomActualSize = function () { - nfCanvasUtils.actualSizeCanvas(); + $timeout(function () { + nfCanvasUtils.actualSizeCanvas(); + }, 0); }; } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-bootstrap.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-bootstrap.js index 536f87b6eb..4396766953 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-bootstrap.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-bootstrap.js @@ -259,7 +259,7 @@ templateComponent.$inject = ['serviceProvider']; labelComponent.$inject = ['serviceProvider']; graphControlsCtrl.$inject = ['serviceProvider', 'navigateCtrl', 'operateCtrl']; - navigateCtrl.$inject = []; + navigateCtrl.$inject = ['$timeout']; operateCtrl.$inject = []; breadcrumbsDirective.$inject = ['breadcrumbsCtrl']; draggableDirective.$inject = [];