Fixes: U4-2690 data type editor, makes 2 requests for the initial load

This commit is contained in:
perploug
2013-10-31 12:44:35 +01:00
parent 7e0e84ae21
commit 72c173dbee

View File

@@ -70,8 +70,9 @@ function DataTypeEditController($scope, $routeParams, $location, dataTypeResourc
}
$scope.$watch("content.selectedEditor", function (newVal, oldVal) {
//when the value changes, we need to dynamically load in the new editor
if (newVal !== null && newVal !== undefined && newVal != oldVal) {
if (oldVal !== null && newVal !== null && newVal !== undefined && newVal != oldVal) {
//we are editing so get the content item from the server
var currDataTypeId = $routeParams.create ? undefined : $routeParams.id;
dataTypeResource.getPreValues(newVal, currDataTypeId)