Fix JS error when creating macros and relation types
This commit is contained in:
committed by
Sebastiaan Janssen
parent
db9d15e1b5
commit
a5e4633377
@@ -13,7 +13,7 @@ function MacrosCreateController($scope, $location, macroResource, navigationServ
|
||||
|
||||
function createItem() {
|
||||
|
||||
if (formHelper.submitForm({ scope: $scope, formCtrl: this.createMacroForm })) {
|
||||
if (formHelper.submitForm({ scope: $scope, formCtrl: $scope.createMacroForm })) {
|
||||
|
||||
var node = $scope.currentNode;
|
||||
|
||||
@@ -25,7 +25,7 @@ function MacrosCreateController($scope, $location, macroResource, navigationServ
|
||||
navigationService.syncTree({ tree: "macros", path: currPath + "," + data, forceReload: true, activate: true });
|
||||
|
||||
// reset form state
|
||||
formHelper.resetForm({ scope: $scope, formCtrl: this.createMacroForm });
|
||||
formHelper.resetForm({ scope: $scope, formCtrl: $scope.createMacroForm });
|
||||
|
||||
// navigate to edit view
|
||||
var currentSection = appState.getSectionState("currentSection");
|
||||
@@ -33,7 +33,7 @@ function MacrosCreateController($scope, $location, macroResource, navigationServ
|
||||
|
||||
|
||||
}, function (err) {
|
||||
formHelper.resetForm({ scope: $scope, formCtrl: this.createMacroForm, hasErrors: true });
|
||||
formHelper.resetForm({ scope: $scope, formCtrl: $scope.createMacroForm, hasErrors: true });
|
||||
if (err.data && err.data.message) {
|
||||
notificationsService.error(err.data.message);
|
||||
navigationService.hideMenu();
|
||||
|
||||
@@ -26,7 +26,7 @@ function RelationTypeCreateController($scope, $location, relationTypeResource, n
|
||||
}
|
||||
|
||||
function createRelationType() {
|
||||
if (formHelper.submitForm({ scope: $scope, formCtrl: this.createRelationTypeForm, statusMessage: "Creating relation type..." })) {
|
||||
if (formHelper.submitForm({ scope: $scope, formCtrl: $scope.createRelationTypeForm, statusMessage: "Creating relation type..." })) {
|
||||
var node = $scope.currentNode;
|
||||
|
||||
relationTypeResource.create(vm.relationType).then(function (data) {
|
||||
@@ -36,12 +36,12 @@ function RelationTypeCreateController($scope, $location, relationTypeResource, n
|
||||
var currentPath = node.path ? node.path : "-1";
|
||||
navigationService.syncTree({ tree: "relationTypes", path: currentPath + "," + data, forceReload: true, activate: true });
|
||||
|
||||
formHelper.resetForm({ scope: $scope, formCtrl: this.createRelationTypeForm });
|
||||
formHelper.resetForm({ scope: $scope, formCtrl: $scope.createRelationTypeForm });
|
||||
|
||||
var currentSection = appState.getSectionState("currentSection");
|
||||
$location.path("/" + currentSection + "/relationTypes/edit/" + data);
|
||||
}, function (err) {
|
||||
formHelper.resetForm({ scope: $scope, formCtrl: this.createRelationTypeForm, hasErrors: true });
|
||||
formHelper.resetForm({ scope: $scope, formCtrl: $scope.createRelationTypeForm, hasErrors: true });
|
||||
if (err.data && err.data.message) {
|
||||
notificationsService.error(err.data.message);
|
||||
navigationService.hideMenu();
|
||||
|
||||
Reference in New Issue
Block a user