Skip to content

Commit 3d466d0

Browse files
committed
Remove unneccessary defaults
1 parent a51a46a commit 3d466d0

File tree

3 files changed

+7
-60
lines changed

3 files changed

+7
-60
lines changed

angular-schema-form-dynamic-select.js

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ angular.module('schemaForm').config(
1010
if ((schema.type === 'string') && ("enum" in schema)) {
1111
var f = schemaFormProvider.stdFormObj(name, schema, options);
1212
f.key = options.path;
13-
f.key = options.path;
1413
f.type = 'strapselect';
1514
options.lookup[sfPathProvider.stringify(options.path)] = f;
1615
return f;
@@ -31,27 +30,6 @@ angular.module('schemaForm').config(
3130

3231
schemaFormProvider.defaults.array.unshift(multiselect);
3332

34-
var selectdynamic = function (name, schema, options) {
35-
if (schema.type === 'string') {
36-
var f = schemaFormProvider.stdFormObj(name, schema, options);
37-
f.key = options.path;
38-
f.type = 'strapselectdynamic';
39-
options.lookup[sfPathProvider.stringify(options.path)] = f;
40-
return f;
41-
}
42-
};
43-
44-
45-
46-
var multiselectdynamic = function (name, schema, options) {
47-
if (schema.type === 'array') {
48-
var f = schemaFormProvider.stdFormObj(name, schema, options);
49-
f.key = options.path;
50-
f.type = 'strapmultiselectdynamic';
51-
options.lookup[sfPathProvider.stringify(options.path)] = f;
52-
return f;
53-
}
54-
};
5533

5634
//Add to the bootstrap directive
5735
schemaFormDecoratorsProvider.addMapping('bootstrapDecorator', 'strapselect',
@@ -155,6 +133,7 @@ angular.module('schemaForm').controller('strapSelectController', ['$scope', '$ht
155133

156134
}
157135
};
136+
158137
$scope.getOptions = function (options) {
159138
// If defined, let the a callback function manipulate the options
160139
if (options.httpPost && options.httpPost.optionsCallback) {
@@ -169,6 +148,7 @@ angular.module('schemaForm').controller('strapSelectController', ['$scope', '$ht
169148
return options;
170149
}
171150
};
151+
172152
$scope.fetchResult = function (options) {
173153
if (!options) {
174154

@@ -218,6 +198,7 @@ angular.module('schemaForm').controller('strapSelectController', ['$scope', '$ht
218198

219199
}
220200
};
201+
221202
$scope.findTitles = function (_form)
222203
{
223204
result = [];
@@ -291,13 +272,11 @@ angular.module('schemaForm').filter('selectFilter', [function ($filter) {
291272
controller.$eval(strLocalModel + "=[]");
292273
}
293274

294-
295275
console.log("Input: " + JSON.stringify(inputArray));
296276
console.log("Output: " + JSON.stringify(data));
297277
console.log("Model value out : " + JSON.stringify(localModel));
298278
console.log("----- Exiting filter for " + controller.form.title + "-----");
299279

300-
301280
return data;
302281
};
303282
}]);

0 commit comments

Comments
 (0)