manual merge of #304

This commit is contained in:
Tony Tam
2013-09-05 10:16:10 -07:00
parent 046e534d03
commit 8a9eedfdf3
4 changed files with 91 additions and 31 deletions

View File

@@ -89,9 +89,10 @@ class OperationView extends Backbone.View
if(o.value? && jQuery.trim(o.value).length > 0)
map["body"] = o.value
for o in form.find("select")
if(o.value? && jQuery.trim(o.value).length > 0)
map[o.name] = o.value
for o in form.find("select")
val = this.getSelectedValue o
if(val? && jQuery.trim(val).length > 0)
map[o.name] = val
opts.responseContentType = $("div select[name=responseContentType]", $(@el)).val()
opts.requestContentType = $("div select[name=parameterContentType]", $(@el)).val()
@@ -102,7 +103,17 @@ class OperationView extends Backbone.View
success: (response, parent) ->
parent.showCompleteStatus response
getSelectedValue: (select) ->
if !select.multiple
select.value
else
options = []
options.push opt.value for opt in select.options when opt.selected
if options.length > 0
options.join ","
else
null
# handler for hide response link
hideResponse: (e) ->
@@ -220,4 +231,4 @@ class OperationView extends Backbone.View
toggleOperationContent: ->
elem = $('#' + Docs.escapeResourceName(@model.resourceName) + "_" + @model.nickname + "_" + @model.method + "_" + @model.number + "_content")
if elem.is(':visible') then Docs.collapseOperation(elem) else Docs.expandOperation(elem)
if elem.is(':visible') then Docs.collapseOperation(elem) else Docs.expandOperation(elem)