Skip to content

Commit

Permalink
Remove unneccessary defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklasb committed May 11, 2015
1 parent a51a46a commit 3d466d0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 60 deletions.
27 changes: 3 additions & 24 deletions angular-schema-form-dynamic-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ angular.module('schemaForm').config(
if ((schema.type === 'string') && ("enum" in schema)) {
var f = schemaFormProvider.stdFormObj(name, schema, options);
f.key = options.path;
f.key = options.path;
f.type = 'strapselect';
options.lookup[sfPathProvider.stringify(options.path)] = f;
return f;
Expand All @@ -31,27 +30,6 @@ angular.module('schemaForm').config(

schemaFormProvider.defaults.array.unshift(multiselect);

var selectdynamic = function (name, schema, options) {
if (schema.type === 'string') {
var f = schemaFormProvider.stdFormObj(name, schema, options);
f.key = options.path;
f.type = 'strapselectdynamic';
options.lookup[sfPathProvider.stringify(options.path)] = f;
return f;
}
};



var multiselectdynamic = function (name, schema, options) {
if (schema.type === 'array') {
var f = schemaFormProvider.stdFormObj(name, schema, options);
f.key = options.path;
f.type = 'strapmultiselectdynamic';
options.lookup[sfPathProvider.stringify(options.path)] = f;
return f;
}
};

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

}
};

$scope.getOptions = function (options) {
// If defined, let the a callback function manipulate the options
if (options.httpPost && options.httpPost.optionsCallback) {
Expand All @@ -169,6 +148,7 @@ angular.module('schemaForm').controller('strapSelectController', ['$scope', '$ht
return options;
}
};

$scope.fetchResult = function (options) {
if (!options) {

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

}
};

$scope.findTitles = function (_form)
{
result = [];
Expand Down Expand Up @@ -291,13 +272,11 @@ angular.module('schemaForm').filter('selectFilter', [function ($filter) {
controller.$eval(strLocalModel + "=[]");
}


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


return data;
};
}]);
Expand Down
Loading

0 comments on commit 3d466d0

Please sign in to comment.