This commit is contained in:
Tony Tam
2015-01-29 23:56:04 -08:00
3 changed files with 16 additions and 16 deletions

2
dist/swagger-ui.js vendored
View File

@@ -1072,7 +1072,7 @@ OperationView = (function(_super) {
OperationView.prototype.mouseEnter = function(e) { OperationView.prototype.mouseEnter = function(e) {
var elem, hgh, pos, scMaxX, scMaxY, scX, scY, wd, x, y; var elem, hgh, pos, scMaxX, scMaxY, scX, scY, wd, x, y;
elem = $(e.currentTarget.parentNode).find('#api_information_panel'); elem = $(this.el).find('.content');
x = e.pageX; x = e.pageX;
y = e.pageY; y = e.pageY;
scX = $(window).scrollLeft(); scX = $(window).scrollLeft();

File diff suppressed because one or more lines are too long

View File

@@ -16,7 +16,7 @@ class OperationView extends Backbone.View
@ @
mouseEnter: (e) -> mouseEnter: (e) ->
elem = $(e.currentTarget.parentNode).find('#api_information_panel') elem = $(@el).find '.content'
x = e.pageX x = e.pageX
y = e.pageY y = e.pageY
scX = $(window).scrollLeft() scX = $(window).scrollLeft()
@@ -98,7 +98,7 @@ class OperationView extends Backbone.View
sampleJSON: @model.responseSampleJSON sampleJSON: @model.responseSampleJSON
isParam: false isParam: false
signature: @model.responseClassSignature signature: @model.responseClassSignature
responseSignatureView = new SignatureView({model: signatureModel, tagName: 'div'}) responseSignatureView = new SignatureView({model: signatureModel, tagName: 'div'})
$('.model-signature', $(@el)).append responseSignatureView.render().el $('.model-signature', $(@el)).append responseSignatureView.render().el
else else
@@ -147,7 +147,7 @@ class OperationView extends Backbone.View
# Render status codes # Render status codes
statusCodeView = new StatusCodeView({model: statusCode, tagName: 'tr'}) statusCodeView = new StatusCodeView({model: statusCode, tagName: 'tr'})
$('.operation-status', $(@el)).append statusCodeView.render().el $('.operation-status', $(@el)).append statusCodeView.render().el
submitOperation: (e) -> submitOperation: (e) ->
e?.preventDefault() e?.preventDefault()
# Check for errors # Check for errors
@@ -185,7 +185,7 @@ class OperationView extends Backbone.View
if(o.value? && jQuery.trim(o.value).length > 0) if(o.value? && jQuery.trim(o.value).length > 0)
map[o.name] = o.value map[o.name] = o.value
for o in form.find("select") for o in form.find("select")
val = this.getSelectedValue o val = this.getSelectedValue o
if(val? && jQuery.trim(val).length > 0) if(val? && jQuery.trim(val).length > 0)
map[o.name] = val map[o.name] = val
@@ -229,7 +229,7 @@ class OperationView extends Backbone.View
bodyParam.append($(el).attr('name'), el.files[0]) bodyParam.append($(el).attr('name'), el.files[0])
params += 1 params += 1
@invocationUrl = @invocationUrl =
if @model.supportHeaderParams() if @model.supportHeaderParams()
headerParams = @model.getHeaderParams(map) headerParams = @model.getHeaderParams(map)
delete headerParams['Content-Type'] delete headerParams['Content-Type']
@@ -237,10 +237,10 @@ class OperationView extends Backbone.View
else else
@model.urlify(map, true) @model.urlify(map, true)
$(".request_url", $(@el)).html("<pre></pre>") $(".request_url", $(@el)).html("<pre></pre>")
$(".request_url pre", $(@el)).text(@invocationUrl); $(".request_url pre", $(@el)).text(@invocationUrl);
obj = obj =
type: @model.method type: @model.method
url: @invocationUrl url: @invocationUrl
headers: headerParams headers: headerParams
@@ -286,12 +286,12 @@ class OperationView extends Backbone.View
o o
getSelectedValue: (select) -> getSelectedValue: (select) ->
if !select.multiple if !select.multiple
select.value select.value
else else
options = [] options = []
options.push opt.value for opt in select.options when opt.selected options.push opt.value for opt in select.options when opt.selected
if options.length > 0 if options.length > 0
options options
else else
null null
@@ -327,7 +327,7 @@ class OperationView extends Backbone.View
lines = xml.split('\n') lines = xml.split('\n')
indent = 0 indent = 0
lastType = 'other' lastType = 'other'
# 4 types of tags - single, closing, opening, other (text, doctype, comment) - 4*4 = 16 transitions # 4 types of tags - single, closing, opening, other (text, doctype, comment) - 4*4 = 16 transitions
transitions = transitions =
'single->single': 0 'single->single': 0
'single->closing': -1 'single->closing': -1
@@ -371,9 +371,9 @@ class OperationView extends Backbone.View
formatted = formatted.substr(0, formatted.length - 1) + ln + '\n' formatted = formatted.substr(0, formatted.length - 1) + ln + '\n'
else else
formatted += padding + ln + '\n' formatted += padding + ln + '\n'
formatted formatted
# puts the response data in UI # puts the response data in UI
showStatus: (response) -> showStatus: (response) ->
@@ -420,7 +420,7 @@ class OperationView extends Backbone.View
pre = $('<pre class="json" />').append(code) pre = $('<pre class="json" />').append(code)
response_body = pre response_body = pre
$(".request_url", $(@el)).html("<pre></pre>") $(".request_url", $(@el)).html("<pre></pre>")
$(".request_url pre", $(@el)).text(url); $(".request_url pre", $(@el)).text(url);
$(".response_code", $(@el)).html "<pre>" + response.status + "</pre>" $(".response_code", $(@el)).html "<pre>" + response.status + "</pre>"
$(".response_body", $(@el)).html response_body $(".response_body", $(@el)).html response_body