Fix JS error preventing newly created dictionary items from opening automatically

(cherry picked from commit 59f90bd08b)
This commit is contained in:
Claus
2020-10-01 09:31:23 +02:00
parent 94d4fef088
commit b48145c87f

View File

@@ -15,7 +15,7 @@ function DictionaryCreateController($scope, $location, dictionaryResource, navig
function createItem() {
if (formHelper.submitForm({ scope: $scope, formCtrl: this.createDictionaryForm })) {
if (formHelper.submitForm({ scope: $scope, formCtrl: $scope.createDictionaryForm })) {
var node = $scope.currentNode;
@@ -27,14 +27,14 @@ function DictionaryCreateController($scope, $location, dictionaryResource, navig
navigationService.syncTree({ tree: "dictionary", path: currPath + "," + data, forceReload: true, activate: true });
// reset form state
formHelper.resetForm({ scope: $scope, formCtrl: this.createDictionaryForm });
formHelper.resetForm({ scope: $scope, formCtrl: $scope.createDictionaryForm });
// navigate to edit view
var currentSection = appState.getSectionState("currentSection");
$location.path("/" + currentSection + "/dictionary/edit/" + data);
}, function (err) {
formHelper.resetForm({ scope: $scope, formCtrl: this.createDictionaryForm, hasErrors: true });
formHelper.resetForm({ scope: $scope, formCtrl: $scope.createDictionaryForm, hasErrors: true });
if (err.data && err.data.message) {
notificationsService.error(err.data.message);
navigationService.hideMenu();