From 642ce36f597fa72eeee652ebde170bf7fe67dc69 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 19 Apr 2018 21:58:59 +1000 Subject: [PATCH] updates when the tree does it's initialization , fixes migration --- .../Upgrade/V_8_0_0/AddContentVariationTable.cs | 2 +- .../components/tree/umbtree.directive.js | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/AddContentVariationTable.cs b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/AddContentVariationTable.cs index ee0a4d7c8a..efd0f33e99 100644 --- a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/AddContentVariationTable.cs +++ b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/AddContentVariationTable.cs @@ -10,7 +10,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0 public override void Migrate() { - Create.Table(); + Create.Table().Do(); // fixme - data migration? } diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtree.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtree.directive.js index 064a34e14b..e25c995da2 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtree.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtree.directive.js @@ -53,7 +53,9 @@ function umbTreeDirective($compile, $log, $q, $rootScope, treeService, notificat controller: function ($scope, $element) { - var vm = this; + var vm = this; + + var isInitialized = false; var registeredCallbacks = { treeNodeExpanded: [], @@ -269,9 +271,17 @@ function umbTreeDirective($compile, $log, $q, $rootScope, treeService, notificat return treeService.getTree(args) .then(function (data) { + //set the data once we have it $scope.tree = data; + //call the callback, this allows for hosting controllers to bind to events and use the exposed API + if (!isInitialized) { + isInitialized = true; + $scope.onInit(); + } + + enableDeleteAnimations(); $scope.loading = false; @@ -421,9 +431,6 @@ function umbTreeDirective($compile, $log, $q, $rootScope, treeService, notificat lastSection = newVal; } }); - - //call the callback, this allows for hosting controllers to bind to events and use the exposed API - $scope.onInit(); loadTree(); }