Skip to content

Commit 01a94f5

Browse files
committed
Add support for noLookup, small bug fix
1 parent 2e1f728 commit 01a94f5

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

dist/forms-angular.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,9 @@ var fng;
10151015
}
10161016
break;
10171017
default:
1018-
newElement += ' fng-fld-' + prop + '="' + info[prop].toString().replace(/"/g, '"') + '"';
1018+
if (info[prop]) {
1019+
newElement += ' fng-fld-' + prop + '="' + info[prop].toString().replace(/"/g, '"') + '"';
1020+
}
10191021
break;
10201022
}
10211023
}
@@ -1885,7 +1887,7 @@ var fng;
18851887
if (formInstructions.select2 || (mongooseOptions.form && mongooseOptions.form.select2)) {
18861888
console.log('support for fng-select2 has been removed in 0.8.3 - please convert to fng-ui-select');
18871889
}
1888-
else if (!formInstructions.directive || !formInstructions[$filter('camelCase')(formInstructions.directive)] || !formInstructions[$filter('camelCase')(formInstructions.directive)].fngAjax) {
1890+
else if (!formInstructions.directive || (!formInstructions.noLookup && (!formInstructions[$filter('camelCase')(formInstructions.directive)] || !formInstructions[$filter('camelCase')(formInstructions.directive)].fngAjax))) {
18891891
performLookupSelect();
18901892
}
18911893
}
@@ -2992,6 +2994,9 @@ var fng;
29922994
console.log('Error parsing specified record : ' + e.message);
29932995
}
29942996
}
2997+
if (typeof $scope.dataEventFunctions.onInitialiseNewRecord === 'function') {
2998+
$scope.dataEventFunctions.onInitialiseNewRecord(ctrlState.master);
2999+
}
29953000
$scope.phase = 'ready';
29963001
$scope.cancel();
29973002
}

dist/forms-angular.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/directives/form.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,9 @@ module fng.directives {
500500
}
501501
break;
502502
default:
503-
newElement += ' fng-fld-' + prop + '="' + info[prop].toString().replace(/"/g, '"') + '"';
503+
if (info[prop]) {
504+
newElement += ' fng-fld-' + prop + '="' + info[prop].toString().replace(/"/g, '"') + '"';
505+
}
504506
break;
505507
}
506508
}

js/services/form-generator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ module fng.services {
161161
formInstructions.type = 'select';
162162
if (formInstructions.select2 || (mongooseOptions.form && mongooseOptions.form.select2)) {
163163
console.log('support for fng-select2 has been removed in 0.8.3 - please convert to fng-ui-select');
164-
} else if (!formInstructions.directive || !formInstructions[$filter('camelCase')(formInstructions.directive)] || !formInstructions[$filter('camelCase')(formInstructions.directive)].fngAjax) {
164+
} else if (!formInstructions.directive || (!formInstructions.noLookup && (!formInstructions[$filter('camelCase')(formInstructions.directive)] || !formInstructions[$filter('camelCase')(formInstructions.directive)].fngAjax))) {
165165
performLookupSelect();
166166
}
167167
}

js/services/record-handler.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,9 @@ module fng.services {
388388
console.log('Error parsing specified record : ' + e.message);
389389
}
390390
}
391+
if (typeof $scope.dataEventFunctions.onInitialiseNewRecord === 'function') {
392+
$scope.dataEventFunctions.onInitialiseNewRecord(ctrlState.master);
393+
}
391394
$scope.phase = 'ready';
392395
$scope.cancel();
393396
}

0 commit comments

Comments
 (0)