JSONEditor enable/disable flag
This commit is contained in:
@@ -175,7 +175,7 @@ class OperationView extends Backbone.View
|
||||
# will replace it with the text "root" which won't look good on screen
|
||||
param.schema.title = " "
|
||||
|
||||
paramView = new ParameterView({model: param, tagName: 'tr', readOnly: @model.isReadOnly})
|
||||
paramView = new ParameterView({model: param, tagName: 'tr', readOnly: @model.isReadOnly, swaggerOptions: @options.swaggerOptions})
|
||||
$('.operation-params', $(@el)).append paramView.render().el
|
||||
|
||||
addStatusCode: (statusCode) ->
|
||||
|
||||
@@ -44,7 +44,7 @@ class ParameterView extends Backbone.View
|
||||
|
||||
isParam = false
|
||||
|
||||
if @model.isBody && @model.schema
|
||||
if @options.swaggerOptions.jsonEditor && @model.isBody && @model.schema
|
||||
$self = $(@el)
|
||||
@model.jsonEditor =
|
||||
new JSONEditor($('.editor_holder', $self)[0],
|
||||
@@ -52,6 +52,8 @@ class ParameterView extends Backbone.View
|
||||
# This is so that the signature can send back the sample to the json editor
|
||||
# TODO: SignatureView should expose an event "onSampleClicked" instead
|
||||
signatureModel.jsonEditor = @model.jsonEditor
|
||||
$('.body-textarea', $self).hide()
|
||||
$('.editor_holder', $self).show()
|
||||
$('.parameter-content-type', $self)
|
||||
.change(
|
||||
(e) ->
|
||||
@@ -63,8 +65,6 @@ class ParameterView extends Backbone.View
|
||||
$('.body-textarea', $self).hide()
|
||||
$('.editor_holder', $self).show()
|
||||
@model.jsonEditor.enable())
|
||||
isParam = true
|
||||
|
||||
|
||||
if @model.isBody
|
||||
isParam = true
|
||||
|
||||
1155
src/main/html/css/print.css
Normal file
1155
src/main/html/css/print.css
Normal file
File diff suppressed because it is too large
Load Diff
@@ -433,7 +433,6 @@
|
||||
width: 300px;
|
||||
height: 100px;
|
||||
border: 1px solid #aaa;
|
||||
display: none;
|
||||
}
|
||||
.swagger-section .swagger-ui-wrap .markdown p code,
|
||||
.swagger-section .swagger-ui-wrap .markdown li code {
|
||||
|
||||
@@ -53,7 +53,8 @@
|
||||
log("Unable to Load SwaggerUI");
|
||||
},
|
||||
docExpansion: "none",
|
||||
sorter : "alpha"
|
||||
sorter : "alpha",
|
||||
jsonEditor:true
|
||||
});
|
||||
|
||||
function addApiKeyAuthorization() {
|
||||
|
||||
@@ -330,7 +330,6 @@
|
||||
width: 300px;
|
||||
height: 100px;
|
||||
border: 1px solid #aaa;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.markdown p code, .markdown li code {
|
||||
|
||||
@@ -8,11 +8,12 @@
|
||||
{{else}}
|
||||
{{#if default}}
|
||||
<div class="editor_holder"></div>
|
||||
<textarea class='body-textarea' name='{{name}}'>{{default}}</textarea>
|
||||
<br />
|
||||
<div class="parameter-content-type" />
|
||||
{{else}}
|
||||
<textarea class='body-textarea' name='{{name}}'></textarea>
|
||||
<div class="editor_holder"></div>
|
||||
<div class="editor_holder"></div>
|
||||
<br />
|
||||
<div class="parameter-content-type" />
|
||||
{{/if}}
|
||||
|
||||
Reference in New Issue
Block a user