Fixed content edit data issue and fixes media controller naming
This commit is contained in:
@@ -1,22 +1,31 @@
|
||||
angular.module("umbraco")
|
||||
.controller("Umbraco.Editors.ContentEditController",
|
||||
function ($scope, $routeParams, contentResource, notificationsService) {
|
||||
|
||||
if($routeParams.create)
|
||||
$scope.content = contentResource.getContentScaffold($routeParams.id, $routeParams.doctype);
|
||||
else
|
||||
$scope.content = contentResource.getContent($routeParams.id);
|
||||
function ($scope, $routeParams, contentResource, notificationsService) {
|
||||
|
||||
if ($routeParams.create) {
|
||||
|
||||
contentResource.getContentScaffold($routeParams.id, $routeParams.doctype)
|
||||
.then(function (data) {
|
||||
$scope.content = data;
|
||||
});
|
||||
}
|
||||
else {
|
||||
contentResource.getContent($routeParams.id)
|
||||
.then(function (data) {
|
||||
$scope.content = data;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$scope.saveAndPublish = function (cnt) {
|
||||
cnt.publishDate = new Date();
|
||||
contentResource.publishContent(cnt);
|
||||
notificationsService.success("Published", "Content has been saved and published");
|
||||
};
|
||||
$scope.saveAndPublish = function (cnt) {
|
||||
cnt.publishDate = new Date();
|
||||
contentResource.publishContent(cnt);
|
||||
notificationsService.success("Published", "Content has been saved and published");
|
||||
};
|
||||
|
||||
$scope.save = function (cnt) {
|
||||
cnt.updateDate = new Date();
|
||||
contentResource.saveContent(cnt);
|
||||
notificationsService.success("Saved", "Content has been saved");
|
||||
};
|
||||
});
|
||||
$scope.save = function (cnt) {
|
||||
cnt.updateDate = new Date();
|
||||
contentResource.saveContent(cnt);
|
||||
notificationsService.success("Saved", "Content has been saved");
|
||||
};
|
||||
});
|
||||
@@ -1,22 +1,22 @@
|
||||
function mediaEditController($scope, $routeParams, contentResource, notificationsService) {
|
||||
if ($routeParams.create)
|
||||
$scope.content = contentResource.getContentScaffold($routeParams.id, $routeParams.doctype);
|
||||
else
|
||||
$scope.content = contentResource.getContent($routeParams.id);
|
||||
|
||||
|
||||
if ($routeParams.create)
|
||||
$scope.content = contentResource.getContentScaffold($routeParams.id, $routeParams.doctype);
|
||||
else
|
||||
$scope.content = contentResource.getContent($routeParams.id);
|
||||
|
||||
|
||||
$scope.saveAndPublish = function (cnt) {
|
||||
cnt.publishDate = new Date();
|
||||
contentResource.publishContent(cnt);
|
||||
cnt.publishDate = new Date();
|
||||
contentResource.publishContent(cnt);
|
||||
notificationsService.success("Published", "Content has been saved and published");
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
$scope.save = function (cnt) {
|
||||
cnt.updateDate = new Date();
|
||||
contentResource.saveContent(cnt);
|
||||
cnt.updateDate = new Date();
|
||||
contentResource.saveContent(cnt);
|
||||
notificationsService.success("Saved", "Content has been saved");
|
||||
};
|
||||
}
|
||||
|
||||
angular.module("umbraco")
|
||||
.controller("Umbraco.Editors.ContentEditController", mediaEditController);
|
||||
.controller("Umbraco.Editors.MediaEditController", mediaEditController);
|
||||
@@ -1,6 +1,6 @@
|
||||
function mediaCreateController ($scope, $routeParams,contentTypeResource) {
|
||||
$scope.allowedTypes = contentTypeResource.getAllowedTypes($scope.currentNode.id);
|
||||
function mediaCreateController ($scope, $routeParams,contentTypeResource) {
|
||||
$scope.allowedTypes = contentTypeResource.getAllowedTypes($scope.currentNode.id);
|
||||
}
|
||||
|
||||
angular.module('umbraco')
|
||||
.controller("Umbraco.Editors.ContentCreateController", mediaCreateController);
|
||||
.controller("Umbraco.Editors.MediaCreateController", mediaCreateController);
|
||||
Reference in New Issue
Block a user