Parse dictionary, avoid unnecessary string conversion

This commit is contained in:
guerler
2016-12-12 00:18:16 -05:00
parent f9abb47ebd
commit 9fc6162b74
4 changed files with 7 additions and 9 deletions
@@ -806,7 +806,7 @@ EditorFormView = Backbone.View.extend({
}
},
showToolForm: function ( text, node ) {
showToolForm: function ( content, node ) {
// initialize tags and identifiers
var cls = 'right-content';
var id = cls + '-' + node.id;
@@ -824,15 +824,15 @@ EditorFormView = Backbone.View.extend({
if ($container.find('#' + id).length == 0) {
var $el = $('<div id="' + id + '" class="' + cls + '"/>');
var formView = null;
if (node.type == 'tool' && Utils.isJSON(text)) {
var options = JSON.parse(text);
if (node.type == 'tool') {
var options = content;
options.node = node;
options.workflow = this.workflow;
options.datatypes = this.datatypes;
formView = new ToolForm.View(options);
} else {
var options = {
html: text,
html: content,
node: node,
workflowView: this
};
+1 -3
View File
@@ -761,9 +761,7 @@ class ToolModule( WorkflowModule ):
self.add_dummy_datasets()
incoming = {}
params_to_incoming( incoming, self.tool.inputs, self.state.inputs, self.trans.app )
return dumps( self.tool.to_json( self.trans, incoming, workflow_building_mode=True ) )
else:
return "Tool missing. Parameters cannot be edited."
return self.tool.to_json( self.trans, incoming, workflow_building_mode=True )
def check_and_update_state( self ):
if self.tool:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long