added array check for #899

This commit is contained in:
Tony Tam
2015-02-02 20:17:50 -08:00
parent f2f939e24e
commit 0da7f8ba69
2 changed files with 4 additions and 1 deletions

View File

@@ -16,6 +16,9 @@ class SwaggerUi extends Backbone.Router
@dom_id = options.dom_id
delete options.dom_id
if not options.supportedSubmitMethods?
options.supportedSubmitMethods = ['get','put','post','delete','head','options','patch']
# Create an empty div which contains the dom_id
$('body').append('<div id="' + @dom_id + '"></div>') if not $('#' + @dom_id)?

View File

@@ -44,7 +44,7 @@ class OperationView extends Backbone.View
$(e.currentTarget.parentNode).find('#api_information_panel').hide()
render: ->
isMethodSubmissionSupported = true #jQuery.inArray(@model.method, @model.supportedSubmitMethods) >= 0
isMethodSubmissionSupported = jQuery.inArray(@model.method, @model.supportedSubmitMethods()) >= 0
@model.isReadOnly = true unless isMethodSubmissionSupported
# 1.2 syntax for description was `notes`