diff --git a/src/scripts/collections/socrata-fields.js b/src/scripts/collections/socrata-fields.js index d7d4c63..c8aa185 100644 --- a/src/scripts/collections/socrata-fields.js +++ b/src/scripts/collections/socrata-fields.js @@ -28,11 +28,16 @@ module.exports = Backbone.Collection.extend({ }, parse: function (response) { return response.columns.map(function (row, key) { + var titleForRow = row.name + if(!_.isEmpty(row.description)){ + titleForRow += ' ' + } return { data: row.fieldName, - title: row.name, + title: titleForRow, type: this.typeMap[row.renderTypeName] || this.typeMap.default, - defaultContent: '' + defaultContent: '', + description: row.description } }, this) } diff --git a/src/scripts/views/table.js b/src/scripts/views/table.js index 6f41a15..da542f5 100644 --- a/src/scripts/views/table.js +++ b/src/scripts/views/table.js @@ -4,6 +4,7 @@ var LoaderOn = require('../util/loader').on var LoaderOff = require('../util/loader').off require('datatables') require('datatables/media/js/dataTables.bootstrap') +require('bootstrap/js/tooltip') module.exports = Card.extend({ initialize: function (options) { @@ -99,6 +100,12 @@ module.exports = Card.extend({ } }) } + + // Initialize bootstrap-powered tooltips + jQuery('.dataTables_scrollHeadInner th span[data-toggle="tooltip"]').tooltip({ + container : 'body' + }); + }, // When another chart is filtered, filter this collection onFilter: function (data) {