diff --git a/src/js/template-loader.js b/src/js/template-loader.js index bfe6a93da..a47970f20 100644 --- a/src/js/template-loader.js +++ b/src/js/template-loader.js @@ -308,7 +308,7 @@ var templateCompiler = function(performanceAwareCaller, templateUrlConverter, te plugins.push(templatesPlugin); // initialize the viewModel object based on the content model. - var viewModel = performanceAwareCaller('initializeViewmodel', initializeViewmodel.bind(this, content, blockModels.blockList, templateUrlConverter, galleryUrl, modelImporter, exportCleanedHTML)); + var viewModel = performanceAwareCaller('initializeViewmodel', initializeViewmodel.bind(this, content, blockModels.blockList, templateUrlConverter, galleryUrl, modelImporter, timedExportCleanedHTML.bind(undefined, performanceAwareCaller))); viewModel.metadata = metadata; // let's run some version check on template and editor used to build the model being loaded. @@ -433,6 +433,10 @@ function conditional_restore(html) { }); } +function timedExportCleanedHTML(performanceAwareCaller, viewModel) { + return performanceAwareCaller("exportCleanedHTML", viewModel); +} + function exportCleanedHTML(viewModel) { var id = 'exportframe'; $('body').append(''); diff --git a/src/js/viewmodel.js b/src/js/viewmodel.js index 00f5a99e1..5e8337c12 100644 --- a/src/js/viewmodel.js +++ b/src/js/viewmodel.js @@ -4,7 +4,6 @@ var $ = require("jquery"); var ko = require("knockout"); var console = require("console"); -var performanceAwareCaller = require("./timed-call.js").timedCall; var toastr = require("toastr"); toastr.options = { @@ -347,12 +346,8 @@ function initializeEditor(content, blocks, thumbPathConverter, galleryUrl, conte global.setTimeout(viewModel.loopSubscriptionsCount, 1000); }; - viewModel.export = function() { - var content = performanceAwareCaller("exportHTML", viewModel.exportHTML); - return content; - }; - - viewModel.exportHTML = function() { + // before 0.18.8 "export" used to log exportHTML timing, but we moved that in the internal exporter function. + viewModel.export = viewModel.exportHTML = function() { content = exportCleanedHTML(viewModel); // Remove trash leftover by TinyMCE