From 0b73a5ffbf7a2e44b0936531ee483d708e34b7b8 Mon Sep 17 00:00:00 2001 From: Rufus Pollock Date: Fri, 6 Jan 2012 13:38:45 +0000 Subject: [PATCH] [#13,refactor][xs]: move rendering of transform preview into view.js from costco.js. * Resolves TODO from e23354eb4e451bb3171ed89e40a7ebe2e3ca927f. --- src/costco.js | 3 +-- src/view.js | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) 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); }