From 7dfa99cdd86d7df5e32dcecc0f30df2ab70dfd3f Mon Sep 17 00:00:00 2001 From: ezsh <ezsh.junk@gmail.com> Date: Mon, 18 May 2020 00:25:48 +0200 Subject: [PATCH] Enable profiling in App.UI.DOM.renderPassage() --- src/debugging/profileInclude.js | 5 ++++- src/js/utilsSC.js | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/debugging/profileInclude.js b/src/debugging/profileInclude.js index c390d6d7da5..eee4ed807d9 100644 --- a/src/debugging/profileInclude.js +++ b/src/debugging/profileInclude.js @@ -137,6 +137,9 @@ globalThis.ProfileInclude = (function() { Macro.add('include', {handler: builtinIncludeHandler}); builtinIncludeHandler = null; } - } + }, + + IncludeBegins: IncludeBegins, + IncludeEnds: IncludeEnds }; })(); diff --git a/src/js/utilsSC.js b/src/js/utilsSC.js index f22ba25c533..af511e4ad9b 100644 --- a/src/js/utilsSC.js +++ b/src/js/utilsSC.js @@ -323,7 +323,13 @@ App.UI.reload = function() { */ App.UI.DOM.renderPassage = function(passageTitle) { const res = document.createDocumentFragment(); + if (ProfileInclude.IsEnabled) { + ProfileInclude.IncludeBegins(passageTitle); + } $(res).wiki(jsInclude(passageTitle)); + if (ProfileInclude.IsEnabled) { + ProfileInclude.IncludeEnds(); + } return res; }; -- GitLab