From 315566db6f6d6dc87285042d0d916ed7e9bbda0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 22 Feb 2022 19:08:12 -0500 Subject: [PATCH] refactor: get rid of template500Function --- public/src/ajaxify.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index fd3c939b12..98845ac07f 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -425,12 +425,7 @@ ajaxify.widgets = { render: render }; }); }; - let template500Function = null; - ajaxify.loadTemplate = function (template, callback) { - if (template === '500' && template500Function) { - return callback(template500Function); - } $.ajax({ url: `${config.asset_base_url}/templates/${template}.js`, dataType: 'text', @@ -458,9 +453,7 @@ ajaxify.widgets = { render: render }; translator.translate(`[[global:reconnecting-message, ${config.siteTitle}]]`); Benchpress.registerLoader(ajaxify.loadTemplate); Benchpress.setGlobal('config', config); - ajaxify.loadTemplate('500', function (renderFunction) { - template500Function = renderFunction; - }); + Benchpress.render('500', {}); // loads and caches the 500.tpl }); }());