Fixes: U4-5930 Lock "Save and publish" once activated
This commit is contained in:
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user