From b48b0eeb85681774abc10fdb89ef8a82d42cdb03 Mon Sep 17 00:00:00 2001 From: amercader Date: Tue, 10 Jul 2012 12:45:35 +0100 Subject: [PATCH] [build][s]: usual build --- dist/recline.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dist/recline.js b/dist/recline.js index 6a052346..f5b4090b 100644 --- a/dist/recline.js +++ b/dist/recline.js @@ -419,6 +419,12 @@ this.recline.Backend.ElasticSearch = this.recline.Backend.ElasticSearch || {}; var es = new my.Wrapper(dataset.url, my.esOptions); var dfd = $.Deferred(); es.mapping().done(function(schema) { + + if (!schema){ + dfd.reject({'message':'Elastic Search did not return a mapping'}); + return; + } + // only one top level key in ES = the type so we can ignore it var key = _.keys(schema)[0]; var fieldData = _.map(schema[key].properties, function(dict, fieldName) { @@ -3333,10 +3339,10 @@ my.SlickGrid = Backbone.View.extend({ // Order them if there is ordering info on the state if (this.state.get('columnsOrder')){ visibleColumns = visibleColumns.sort(function(a,b){ - return _.indexOf(self.state.get('columnsOrder'),a.id) > _.indexOf(self.state.get('columnsOrder'),b.id); + return _.indexOf(self.state.get('columnsOrder'),a.id) > _.indexOf(self.state.get('columnsOrder'),b.id) ? 1 : -1; }); columns = columns.sort(function(a,b){ - return _.indexOf(self.state.get('columnsOrder'),a.id) > _.indexOf(self.state.get('columnsOrder'),b.id); + return _.indexOf(self.state.get('columnsOrder'),a.id) > _.indexOf(self.state.get('columnsOrder'),b.id) ? 1 : -1; }); }