Fixes: U4-5930 Lock "Save and publish" once activated

This commit is contained in:
Shannon
2014-12-04 13:09:28 +11:00
parent dfb324b003
commit 464130a102
3 changed files with 9 additions and 8 deletions

View File

@@ -31,7 +31,10 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, notifica
var deferred = $q.defer();
if (formHelper.submitForm({ scope: args.scope, statusMessage: args.statusMessage })) {
if (!args.scope.busy && formHelper.submitForm({ scope: args.scope, statusMessage: args.statusMessage })) {
args.scope.busy = true;
args.saveMethod(args.content, $routeParams.create, fileManager.getFiles())
.then(function (data) {
@@ -42,6 +45,8 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, notifica
savedContent: data,
rebindCallback: self.reBindChangedProperties(args.content, data)
});
args.scope.busy = false;
deferred.resolve(data);
}, function (err) {
@@ -50,6 +55,7 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, notifica
err: err,
rebindCallback: self.reBindChangedProperties(args.content, err.data)
});
args.scope.busy = false;
deferred.reject(err);
});
}

View File

@@ -12,16 +12,13 @@ function ContentEditDialogController($scope, editorState, $routeParams, $q, $tim
scope: $scope,
content: $scope.content
}).then(function (content) {
//success
$scope.busy = false;
//success
if (dialogOptions.closeOnSave) {
$scope.submit(content);
}
}, function(err) {
//error
$scope.busy = false;
});
}

View File

@@ -73,13 +73,11 @@ function ContentEditController($scope, $rootScope, $routeParams, $q, $timeout, $
scope: $scope,
content: $scope.content
}).then(function (data) {
//success
$scope.busy = false;
//success
init($scope.content);
syncTreeNode($scope.content, data.path);
}, function (err) {
//error
$scope.busy = false;
if (err) {
editorState.set($scope.content);
}