Modified commit for the https://github.com/wordnik/swagger-ui/pull/414
Brings backward compatibility for the 'allowMultiple' attribute.
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
class ParameterView extends Backbone.View
|
||||
initialize: ->
|
||||
|
||||
Handlebars.registerHelper 'isArray',
|
||||
(param, opts) ->
|
||||
if param.type.toLowerCase() == 'array' || param.allowMultiple
|
||||
opts.fn(@)
|
||||
else
|
||||
opts.inverse(@)
|
||||
|
||||
render: ->
|
||||
type = @model.type || @model.dataType
|
||||
@model.isBody = true if @model.paramType == 'body'
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<td class='code'>{{name}}</td>
|
||||
<td>
|
||||
<select {{#if allowMultiple}} multiple='multiple'{{/if}} class='parameter' name='{{name}}'>
|
||||
<select {{#isArray this}} multiple='multiple'{{/isArray}} class='parameter' name='{{name}}'>
|
||||
{{#if required}}
|
||||
{{else}}
|
||||
{{#if defaultValue}}
|
||||
{{else}}
|
||||
{{#if allowMultiple}}
|
||||
{{else}}
|
||||
{{#isArray this}}
|
||||
{{else}}
|
||||
<option selected="" value=''></option>
|
||||
{{/if}}
|
||||
{{/isArray}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{#each allowableValues.descriptiveValues}}
|
||||
|
||||
Reference in New Issue
Block a user