From f372c9c12db8cd92013c8f85d4aa6f94d31bd393 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 24 Sep 2020 18:25:59 -0400 Subject: [PATCH] feat: child themes - disable features if it doesn't exist instead of erroring out --- public/persona.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/public/persona.js b/public/persona.js index 8706c39..d174bc4 100644 --- a/public/persona.js +++ b/public/persona.js @@ -28,6 +28,10 @@ $(document).ready(function () { } function configureNavbarHiding() { + if (!$.fn.autoHidingNavbar) { + return; + } + var navbarEl = $(".navbar-fixed-top"); navbarEl.autoHidingNavbar('destroy'); navbarEl.css('top', ''); @@ -41,6 +45,10 @@ $(document).ready(function () { } function setupNProgress() { + if (typeof NProgress === 'undefined') { + return; + } + $(window).on('action:ajaxify.start', function () { NProgress.set(0.7); }); @@ -141,7 +149,6 @@ $(document).ready(function () { return; } - require(['pulling', 'storage'], function (Pulling, Storage) { if (!Pulling) { return; @@ -425,7 +432,9 @@ $(document).ready(function () { $(window).on('action:ajaxify.end', function (ev, data) { if (data.url && data.url.match('^topic/') && config.enableQuickReply) { require(['persona/quickreply'], function (quickreply) { - quickreply.init(); + if (quickreply) { + quickreply.init(); + } }); } });