This commit is contained in:
Tony Tam
2013-07-17 16:02:47 -07:00
parent e72dbd6bc6
commit df20d2bd5e
6 changed files with 67 additions and 16 deletions

View File

@@ -31,6 +31,13 @@ class OperationView extends Backbone.View
contentTypeModel.consumes = @model.consumes
contentTypeModel.produces = @model.produces
for param in @model.parameters
console.log "looking at " + param.dataType
if param.dataType.toLowerCase() == 'file'
if !contentTypeModel.consumes
console.log "set content type "
contentTypeModel.consumes = 'multipart/form-data'
responseContentTypeView = new ResponseContentTypeView({model: contentTypeModel})
$('.response-content-type', $(@el)).append responseContentTypeView.render().el
@@ -74,7 +81,7 @@ class OperationView extends Backbone.View
#if(o.value? && jQuery.trim(o.value).length > 0)
#map[o.name] = o.value
for o in form.find(".body-textarea,.parameter")
for o in form.find("input")
if(o.value? && jQuery.trim(o.value).length > 0)
map[o.name] = encodeURI(o.value)

View File

@@ -3,7 +3,7 @@ class ParameterView extends Backbone.View
render: ->
@model.isBody = true if @model.paramType == 'body'
@model.isFile = true if @model.dataType == 'file'
@model.isFile = true if @model.dataType.toLowerCase() == 'file'
template = @template()
$(@el).html(template(@model))