Commit d3dc7bb7 authored by Hellmich, Christoph's avatar Hellmich, Christoph
Browse files

Rename tree to treeService

parent fd832197
......@@ -56,7 +56,7 @@ angular.module('ddaApp')
fgConfigProvider.validation.message(validationMessages);
fgConfigProvider.validation.pattern(validationPattern);
})
.controller('WizardEditorController', function($scope, $state, entity, Wizard, Step, Element, tree) {
.controller('WizardEditorController', function($scope, $state, entity, Wizard, Step, Element, treeService) {
var deletedFields = [];
$scope.formDirty = false; // TODO: use $dirty, or something else
......@@ -76,7 +76,7 @@ angular.module('ddaApp')
$scope.treeOptions = {
beforeDrop: function(e) {
return tree.updateStepPosition(e.source.nodeScope.$modelValue,
return treeService.updateStepPosition(e.source.nodeScope.$modelValue,
e.dest.nodesScope.node ? e.dest.nodesScope.node : undefined,
e.dest.index);
}
......@@ -194,7 +194,7 @@ angular.module('ddaApp')
$scope.addSubStep = function(scope) {
var parent = scope.$modelValue;
tree.addSubStep(scope.$modelValue).then(function(step) {
treeService.addSubStep(scope.$modelValue).then(function(step) {
step.nodes = [];
parent.nodes.push(step);
});
......@@ -209,8 +209,8 @@ angular.module('ddaApp')
Wizard.steps({
id: $state.params.id
}, function(steps) {
$scope.tree = tree.buildAngularUiTree(steps);
loadFields(tree.getStep($state.params.stepId));
$scope.tree = treeService.buildAngularUiTree(steps);
loadFields(treeService.getStep($state.params.stepId));
$scope.isLoading = false;
});
}
......
'use strict';
angular
.module('ddaApp').factory('tree', function(Step) {
.module('ddaApp').factory('treeService', function(Step) {
var steps = [];
function getStep(stepId) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment