Fixing sorter typo
Original code didn't work because of a mix between the use of 'apisSorters' and 'apisSorter' references. Changed all 'apisSorters' refs to 'apisSorter'.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
SwaggerUi.Views.MainView = Backbone.View.extend({
|
SwaggerUi.Views.MainView = Backbone.View.extend({
|
||||||
apisSorters : {
|
apisSorter : {
|
||||||
alpha : function(a,b){ return a.name.localeCompare(b.name); }
|
alpha : function(a,b){ return a.name.localeCompare(b.name); }
|
||||||
},
|
},
|
||||||
operationsSorters : {
|
operationsSorters : {
|
||||||
@@ -20,7 +20,7 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
|
|||||||
if (_.isFunction(sorterOption)) {
|
if (_.isFunction(sorterOption)) {
|
||||||
sorterFn = sorterOption;
|
sorterFn = sorterOption;
|
||||||
} else {
|
} else {
|
||||||
sorterFn = this.apisSorters[sorterOption];
|
sorterFn = this.apisSorter[sorterOption];
|
||||||
}
|
}
|
||||||
if (_.isFunction(sorterFn)) {
|
if (_.isFunction(sorterFn)) {
|
||||||
this.model.apisArray.sort(sorterFn);
|
this.model.apisArray.sort(sorterFn);
|
||||||
|
|||||||
Reference in New Issue
Block a user