diff --git a/lib/assets/javascripts/cartodb/table/map/edit_feature_fields_dialog.js b/lib/assets/javascripts/cartodb/table/map/edit_feature_fields_dialog.js index 4acb835e83..2519ff34d1 100644 --- a/lib/assets/javascripts/cartodb/table/map/edit_feature_fields_dialog.js +++ b/lib/assets/javascripts/cartodb/table/map/edit_feature_fields_dialog.js @@ -23,31 +23,18 @@ 'string': 'String' }, - render: function() { - cdb.ui.common.Dialog.prototype.render.call(this); - this.activeWizardOption(this.option); - - // Custom scroll code (showing gradients at the end and beginning of the content) - this.scroll = new cdb.admin.CustomScrolls({ - parent: this.$('div.content'), - el: this.$('div.content > div.wrapper') - }); - - this.addView(this.scroll); - - return this; - }, - /** * Render content */ render_content: function() { - var $content = $('
').addClass('wrapper') + var $content = $('
').addClass('edit_content') + , $wrapper = $('
').addClass('wrapper') , self = this , schema = this.options.table.get('schema') , hiddenColumns = this.options.table.hiddenColumns; + _.each(this.model.attributes,function(val,attr){ if (!_.contains(hiddenColumns,attr)) { // Get column type @@ -67,13 +54,23 @@ }, self) // Add to content - $content.append(subView.render().el); + $wrapper.append(subView.render().el); // Add subview to this view (cleaning purposes) self.addView(subView); } }); + // Custom scroll code (showing gradients at the end and beginning of the content) + var scroll = new cdb.admin.CustomScrolls({ + parent: $content, + el: $wrapper + }); + + this.addView(scroll); + + $content.append($wrapper); + return $content; }, @@ -81,7 +78,8 @@ // Get values from the subviews var new_model = {}; _(this._subviews).each(function(v) { - new_model[v.model.get("attribute")] = v.model.get("value"); + if (v.model && v.model.get('value')) + new_model[v.model.get("attribute")] = v.model.get("value"); }); // Set row model