fixes publish button so it saves properly without causing js errors

This commit is contained in:
Shannon
2015-02-11 18:23:49 +11:00
parent 24ef0dd961
commit 4874a71e72

View File

@@ -68,6 +68,8 @@ function ContentEditController($scope, $rootScope, $routeParams, $q, $timeout, $
// This is a helper method to reduce the amount of code repitition for actions: Save, Publish, SendToPublish
function performSave(args) {
var deferred = $q.defer();
contentEditingHelper.contentEditorPerformSave({
statusMessage: args.statusMessage,
saveMethod: args.saveMethod,
@@ -77,12 +79,17 @@ function ContentEditController($scope, $rootScope, $routeParams, $q, $timeout, $
//success
init($scope.content);
syncTreeNode($scope.content, data.path);
deferred.resolve(data);
}, function (err) {
//error
if (err) {
editorState.set($scope.content);
}
deferred.reject(err);
});
return deferred.promise;
}
function resetLastListPageNumber(content) {