diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttype/dialogs/editdatatype/editdatatype.controller.js b/src/Umbraco.Web.UI.Client/src/views/documenttype/dialogs/editdatatype/editdatatype.controller.js index bc3a363e63..482aa1afdb 100644 --- a/src/Umbraco.Web.UI.Client/src/views/documenttype/dialogs/editdatatype/editdatatype.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/documenttype/dialogs/editdatatype/editdatatype.controller.js @@ -8,57 +8,15 @@ */ function EditDataTypeController($scope, dataTypeResource) { + getDataType($scope.model.property.dataTypeId); - editDataType($scope.model.property.dataType.id); - - function editDataType(dataTypeId) { - + function getDataType(dataTypeId) { dataTypeResource.getById(dataTypeId) - .then(function(data) { - - console.log(data); - - //$scope.loaded = true; - //$scope.preValuesLoaded = true; - //$scope.content = data; - - $scope.model.property.dataType.preValues = data.preValues; - - createPreValueProps($scope.model.property.dataType.preValues); - - //share state - //editorState.set($scope.content); - - //in one particular special case, after we've created a new item we redirect back to the edit - // route but there might be server validation errors in the collection which we need to display - // after the redirect, so we will bind all subscriptions which will show the server validation errors - // if there are any and then clear them so the collection no longer persists them. - //serverValidationManager.executeAndClearAllSubscriptions(); - - /* - navigationService.syncTree({ tree: "datatype", path: [String(data.id)] }).then(function (syncArgs) { - $scope.currentNode = syncArgs.node; - }); - */ + .then(function(dataType) { + $scope.model.dataType = dataType; }); - } - function createPreValueProps(preVals) { - $scope.preValues = []; - for (var i = 0; i < preVals.length; i++) { - $scope.preValues.push({ - hideLabel: preVals[i].hideLabel, - alias: preVals[i].key, - description: preVals[i].description, - label: preVals[i].label, - view: preVals[i].view, - value: preVals[i].value - }); - } - } - - } angular.module("umbraco").controller("Umbraco.Editors.DocumentType.EditDataTypeController", EditDataTypeController); diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttype/dialogs/editdatatype/editdatatype.html b/src/Umbraco.Web.UI.Client/src/views/documenttype/dialogs/editdatatype/editdatatype.html index b5761d16e9..7766381213 100644 --- a/src/Umbraco.Web.UI.Client/src/views/documenttype/dialogs/editdatatype/editdatatype.html +++ b/src/Umbraco.Web.UI.Client/src/views/documenttype/dialogs/editdatatype/editdatatype.html @@ -1,16 +1,19 @@
{{ model | json }}
@@ -45,15 +51,5 @@
-
-