diff --git a/lib/editview/data.js b/lib/editview/data.js index f7ba527..e201f5c 100644 --- a/lib/editview/data.js +++ b/lib/editview/data.js @@ -49,18 +49,18 @@ var stc = { {text: options[1], value: 0} ]; }, - // loopColumns - add docs + // loopColumns get: function (args) { var columns = args.config.columns; for (var i=0; i < columns.length; i++) { var control = columns[i].control; if (!(control.options instanceof Array)) continue; - switch (true) { - case control.select: - columns[i].value = stc.getSelect(control.options); break; - case control.radio: - columns[i].value = stc.getRadio(control.options); break; + if (control.select) { + columns[i].value = stc.getSelect(control.options); + } + else if (control.radio) { + columns[i].value = stc.getRadio(control.options); } } } diff --git a/lib/editview/index.js b/lib/editview/index.js index fc6822b..d2288b4 100644 --- a/lib/editview/index.js +++ b/lib/editview/index.js @@ -53,6 +53,7 @@ function getTables (args, done) { exports.getTypes = function (args, done) { var result = {}; + args.config = dcopy(args.settings[args.name]); async.eachSeries(['view', 'oneToOne', 'manyToOne'], function (type, done) { args.type = type; @@ -70,6 +71,12 @@ exports.getTypes = function (args, done) { done(); }); }, function (err) { + delete args.type; + delete args.tables; + delete args.post; + delete args.files; + delete args.config; + delete args.fk; done(err, result); }); } diff --git a/routes/editview.js b/routes/editview.js index 9bd1fa2..d8f4e49 100644 --- a/routes/editview.js +++ b/routes/editview.js @@ -17,7 +17,6 @@ function getArgs (req, res) { upath : res.locals._admin.config.app.upload }; args.name = res.locals._admin.slugs[args.slug]; - args.config = dcopy(args.settings[args.name]); return args; }