Remove redundant setFailure function

pull/3747/head
Alex Dik 9 years ago
parent b5a4601a0e
commit 20dd5ee662
  1. 15
      frontend/app/components/inplace-edit/directives/edit-pane/edit-pane.directive.js

@ -113,7 +113,12 @@ function InplaceEditorEditPaneController($scope, $element, $location, $timeout,
}; };
this.handleFailure = function(e, submit) { this.handleFailure = function(e, submit) {
setFailure(e); afterError();
EditableFieldsState.errors = {
_common: ApiHelper.getErrorMessages(e)
};
showErrors();
submit.reject(e); submit.reject(e);
}; };
@ -191,6 +196,7 @@ function InplaceEditorEditPaneController($scope, $element, $location, $timeout,
}; };
this.discardEditing = function() { this.discardEditing = function() {
$scope.fieldController.isEditing = false;
EditableFieldsState.discard(field.name); EditableFieldsState.discard(field.name);
}; };
@ -215,13 +221,6 @@ function InplaceEditorEditPaneController($scope, $element, $location, $timeout,
$scope.fieldController.state.isBusy = false; $scope.fieldController.state.isBusy = false;
$scope.focusInput(); $scope.focusInput();
} }
function setFailure(e) {
afterError();
EditableFieldsState.errors = {
'_common': ApiHelper.getErrorMessages(e)
};
showErrors();
}
$scope.$watch('editableFieldsState.editAll.state', function(state) { $scope.$watch('editableFieldsState.editAll.state', function(state) {
$scope.fieldController.isEditing = state; $scope.fieldController.isEditing = state;

Loading…
Cancel
Save