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') ...@@ -56,7 +56,7 @@ angular.module('ddaApp')
fgConfigProvider.validation.message(validationMessages); fgConfigProvider.validation.message(validationMessages);
fgConfigProvider.validation.pattern(validationPattern); 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 = []; var deletedFields = [];
$scope.formDirty = false; // TODO: use $dirty, or something else $scope.formDirty = false; // TODO: use $dirty, or something else
...@@ -76,7 +76,7 @@ angular.module('ddaApp') ...@@ -76,7 +76,7 @@ angular.module('ddaApp')
$scope.treeOptions = { $scope.treeOptions = {
beforeDrop: function(e) { 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.nodesScope.node ? e.dest.nodesScope.node : undefined,
e.dest.index); e.dest.index);
} }
...@@ -194,7 +194,7 @@ angular.module('ddaApp') ...@@ -194,7 +194,7 @@ angular.module('ddaApp')
$scope.addSubStep = function(scope) { $scope.addSubStep = function(scope) {
var parent = scope.$modelValue; var parent = scope.$modelValue;
tree.addSubStep(scope.$modelValue).then(function(step) { treeService.addSubStep(scope.$modelValue).then(function(step) {
step.nodes = []; step.nodes = [];
parent.nodes.push(step); parent.nodes.push(step);
}); });
...@@ -209,8 +209,8 @@ angular.module('ddaApp') ...@@ -209,8 +209,8 @@ angular.module('ddaApp')
Wizard.steps({ Wizard.steps({
id: $state.params.id id: $state.params.id
}, function(steps) { }, function(steps) {
$scope.tree = tree.buildAngularUiTree(steps); $scope.tree = treeService.buildAngularUiTree(steps);
loadFields(tree.getStep($state.params.stepId)); loadFields(treeService.getStep($state.params.stepId));
$scope.isLoading = false; $scope.isLoading = false;
}); });
} }
......
'use strict'; 'use strict';
angular angular
.module('ddaApp').factory('tree', function(Step) { .module('ddaApp').factory('treeService', function(Step) {
var steps = []; var steps = [];
function getStep(stepId) { 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