updates when the tree does it's initialization , fixes migration
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user