expand collapse buttons

This commit is contained in:
Laurent Lepinay
2015-05-18 15:34:35 +02:00
parent f16c265087
commit dd5fab0b20
11 changed files with 60 additions and 11 deletions

6
dist/css/screen.css vendored
View File

@@ -1254,3 +1254,9 @@
text-align: center;
padding-top: 10px;
}
.swagger-section .swagger-collapse:before {
content: "-";
}
.swagger-section .swagger-expand:before {
content: "+";
}

BIN
dist/images/collapse.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 B

BIN
dist/images/expand.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 B

16
dist/swagger-ui.js vendored
View File

@@ -65,6 +65,16 @@ window.SwaggerUi = Backbone.Router.extend({
this.headerView.on('update-swagger-ui', function(data) {
return that.updateSwaggerUi(data);
});
// JSon Editor custom theming
JSONEditor.defaults.iconlibs.swagger = JSONEditor.AbstractIconLib.extend({
mapping: {
collapse: 'collapse',
expand: 'expand'
},
icon_prefix: 'swagger-'
});
},
// Set an option after initializing
@@ -21567,7 +21577,11 @@ SwaggerUi.Views.ParameterView = Backbone.View.extend({
this.model.jsonEditor =
/* global JSONEditor */
new JSONEditor($('.editor_holder', $self)[0],
{schema: this.model.schema, startval : this.model.default, ajax:true, disable_properties:true, disable_edit_json:true });
{schema: this.model.schema, startval : this.model.default,
ajax:true,
disable_properties:true,
disable_edit_json:true,
iconlib: 'swagger' });
// 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 = this.model.jsonEditor;

File diff suppressed because one or more lines are too long

View File

@@ -1254,3 +1254,9 @@
text-align: center;
padding-top: 10px;
}
.swagger-section .swagger-collapse:before {
content: "-";
}
.swagger-section .swagger-expand:before {
content: "+";
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 B

View File

@@ -59,6 +59,16 @@ window.SwaggerUi = Backbone.Router.extend({
this.headerView.on('update-swagger-ui', function(data) {
return that.updateSwaggerUi(data);
});
// JSon Editor custom theming
JSONEditor.defaults.iconlibs.swagger = JSONEditor.AbstractIconLib.extend({
mapping: {
collapse: 'collapse',
expand: 'expand'
},
icon_prefix: 'swagger-'
});
},
// Set an option after initializing

View File

@@ -60,7 +60,11 @@ SwaggerUi.Views.ParameterView = Backbone.View.extend({
this.model.jsonEditor =
/* global JSONEditor */
new JSONEditor($('.editor_holder', $self)[0],
{schema: this.model.schema, startval : this.model.default, ajax:true, disable_properties:true, disable_edit_json:true });
{schema: this.model.schema, startval : this.model.default,
ajax:true,
disable_properties:true,
disable_edit_json:true,
iconlib: 'swagger' });
// 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 = this.model.jsonEditor;

View File

@@ -136,4 +136,14 @@
padding-top: 10px;
}
.swagger-collapse:before {
content: "-";
}
.swagger-expand:before {
content: "+";
}
}