Remove [].forEach calls
This commit is contained in:
11
dist/swagger-ui.js
vendored
11
dist/swagger-ui.js
vendored
@@ -1236,7 +1236,8 @@ var MainView = Backbone.View.extend({
|
||||
|
||||
var resources = {};
|
||||
var counter = 0;
|
||||
this.model.apisArray.forEach(function(resource) {
|
||||
for (var i = 0; i < this.model.apisArray.length; i++) {
|
||||
var resource = this.model.apisArray[i];
|
||||
var id = resource.name;
|
||||
while (typeof resources[id] !== 'undefined') {
|
||||
id = id + '_' + counter;
|
||||
@@ -1245,7 +1246,7 @@ var MainView = Backbone.View.extend({
|
||||
resource.id = id;
|
||||
resources[id] = resource;
|
||||
this.addResource(resource, this.model.auths);
|
||||
});
|
||||
}
|
||||
|
||||
$('.propWrap').hover(function onHover(){
|
||||
$('.optionsWrapper', $(this)).show();
|
||||
@@ -2033,8 +2034,8 @@ var ResourceView = Backbone.View.extend({
|
||||
$(this.el).html(Handlebars.templates.resource(this.model));
|
||||
|
||||
// Render each operation
|
||||
this.model.operationsArray.forEach(function(operation){
|
||||
|
||||
for (var i = 0; i < this.model.operationsArray.length; i++) {
|
||||
var operation = this.model.operationsArray[i];
|
||||
var counter = 0;
|
||||
var id = operation.nickname;
|
||||
|
||||
@@ -2048,7 +2049,7 @@ var ResourceView = Backbone.View.extend({
|
||||
operation.nickname = id;
|
||||
operation.parentId = this.model.id;
|
||||
this.addOperation(operation);
|
||||
});
|
||||
};
|
||||
|
||||
$('.toggleEndpointList', this.el).click(this.callDocs.bind(this, 'toggleEndpointListForResource'));
|
||||
$('.collapseResource', this.el).click(this.callDocs.bind(this, 'collapseOperationsForResource'));
|
||||
|
||||
2
dist/swagger-ui.min.js
vendored
2
dist/swagger-ui.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -68,7 +68,8 @@ var MainView = Backbone.View.extend({
|
||||
|
||||
var resources = {};
|
||||
var counter = 0;
|
||||
this.model.apisArray.forEach(function(resource) {
|
||||
for (var i = 0; i < this.model.apisArray.length; i++) {
|
||||
var resource = this.model.apisArray[i];
|
||||
var id = resource.name;
|
||||
while (typeof resources[id] !== 'undefined') {
|
||||
id = id + '_' + counter;
|
||||
@@ -77,7 +78,7 @@ var MainView = Backbone.View.extend({
|
||||
resource.id = id;
|
||||
resources[id] = resource;
|
||||
this.addResource(resource, this.model.auths);
|
||||
});
|
||||
}
|
||||
|
||||
$('.propWrap').hover(function onHover(){
|
||||
$('.optionsWrapper', $(this)).show();
|
||||
|
||||
@@ -19,8 +19,8 @@ var ResourceView = Backbone.View.extend({
|
||||
$(this.el).html(Handlebars.templates.resource(this.model));
|
||||
|
||||
// Render each operation
|
||||
this.model.operationsArray.forEach(function(operation){
|
||||
|
||||
for (var i = 0; i < this.model.operationsArray.length; i++) {
|
||||
var operation = this.model.operationsArray[i];
|
||||
var counter = 0;
|
||||
var id = operation.nickname;
|
||||
|
||||
@@ -34,7 +34,7 @@ var ResourceView = Backbone.View.extend({
|
||||
operation.nickname = id;
|
||||
operation.parentId = this.model.id;
|
||||
this.addOperation(operation);
|
||||
});
|
||||
};
|
||||
|
||||
$('.toggleEndpointList', this.el).click(this.callDocs.bind(this, 'toggleEndpointListForResource'));
|
||||
$('.collapseResource', this.el).click(this.callDocs.bind(this, 'collapseOperationsForResource'));
|
||||
|
||||
Reference in New Issue
Block a user