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:
Dan Rice
2015-03-25 14:53:40 +00:00
parent a7093e68a5
commit 7979f75ff9

View File

@@ -1,7 +1,7 @@
'use strict';
SwaggerUi.Views.MainView = Backbone.View.extend({
apisSorters : {
apisSorter : {
alpha : function(a,b){ return a.name.localeCompare(b.name); }
},
operationsSorters : {
@@ -20,7 +20,7 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
if (_.isFunction(sorterOption)) {
sorterFn = sorterOption;
} else {
sorterFn = this.apisSorters[sorterOption];
sorterFn = this.apisSorter[sorterOption];
}
if (_.isFunction(sorterFn)) {
this.model.apisArray.sort(sorterFn);