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)

View File

@@ -1,16 +1,19 @@
<td class='code'>{{name}}</td>
<td>
<select class='parameter' name='{{name}}'>
<select {{#if allowMultiple}} multiple='multiple'{{/if}} class='parameter' name='{{name}}'>
{{#if required}}
{{else}}
{{#if defaultValue}}
{{else}}
<option selected="" value=''></option>
{{#if allowMultiple}}
{{else}}
<option selected="" value=''></option>
{{/if}}
{{/if}}
{{/if}}
{{#each allowableValues.descriptiveValues}}
{{#if isDefault}}
<option selected="" value='{{value}}'>{{value}} (default)</option>
<option value='{{value}}'>{{value}} (default)</option>
{{else}}
<option value='{{value}}'>{{value}}</option>
{{/if}}
@@ -19,4 +22,4 @@
</td>
<td>{{{description}}}</td>
<td>{{{paramType}}}</td>
<td><span class="model-signature"></span></td>
<td><span class="model-signature"></span></td>