diff --git a/src/costco.js b/src/costco.js index edce7590..2256b3c3 100755 --- a/src/costco.js +++ b/src/costco.js @@ -25,8 +25,7 @@ var costco = function() { preview.push({before: JSON.stringify(before), after: JSON.stringify(after)}); } } - // TODO: 2012-01-05 Move this out of this function and up into (view) functions that call this - util.render('editPreview', 'expression-preview-container', {rows: preview}); + return preview; } function mapDocs(docs, editFunc) { diff --git a/src/view.js b/src/view.js index a34df2b5..3464a825 100644 --- a/src/view.js +++ b/src/view.js @@ -469,7 +469,8 @@ my.ColumnTransform = Backbone.View.extend({ var docs = self.model.currentDocuments.map(function(doc) { return doc.toJSON(); }); - costco.previewTransform(docs, editFunc, self.state.currentColumn); + var previewData = costco.previewTransform(docs, editFunc, self.state.currentColumn); + util.render('editPreview', 'expression-preview-container', {rows: previewData}); } else { errors.text(editFunc.errorMessage); }