diff --git a/src/model.js b/src/model.js index 1651559d..5a9a848a 100644 --- a/src/model.js +++ b/src/model.js @@ -256,12 +256,13 @@ my.Dataset = Backbone.Model.extend({ // // Get a simple html summary of a Dataset record in form of key/value list recordSummary: function(record) { - var html = ''; + var html = '
'; this.fields.each(function(field) { if (field.id != 'id') { - html += '
' + field.get('label') + ': ' + record.getFieldValue(field) + '
'; + html += '
' + field.get('label') + ': ' + record.getFieldValue(field) + '
'; } }); + html += '
'; return html; }, diff --git a/src/view.timeline.js b/src/view.timeline.js index d5e862bd..4dea2c32 100644 --- a/src/view.timeline.js +++ b/src/view.timeline.js @@ -102,7 +102,7 @@ my.Timeline = Backbone.View.extend({ "startDate": start, "endDate": end, "headline": String(record.get('title') || ''), - "text": record.get('description') || record.summary() + "text": record.get('description') || this.model.recordSummary(record) }; return tlEntry; } else { diff --git a/test/view.timeline.test.js b/test/view.timeline.test.js index 2545340b..416d4eb3 100644 --- a/test/view.timeline.test.js +++ b/test/view.timeline.test.js @@ -22,13 +22,13 @@ test('extract dates and timelineJSON', function () { 'startDate': new Date('2012-03-20'), 'endDate': null, 'headline': '1', - 'text': '
Date: 2012-03-20
title: 1
' + 'text': '
Date: 2012-03-20
title: 1
' }, { 'startDate': new Date('2012-03-25'), 'endDate': null, 'headline': '2', - 'text': '
Date: 2012-03-25
title: 2
' + 'text': '
Date: 2012-03-25
title: 2
' } ] }