From 7979f75ff918db3e6170e7d53cd2fc3e6ddd101d Mon Sep 17 00:00:00 2001 From: Dan Rice Date: Wed, 25 Mar 2015 14:53:40 +0000 Subject: [PATCH] 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'. --- src/main/javascript/view/MainView.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/javascript/view/MainView.js b/src/main/javascript/view/MainView.js index fd618b90..b94704b7 100644 --- a/src/main/javascript/view/MainView.js +++ b/src/main/javascript/view/MainView.js @@ -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);