From ae36ee6a149e532d594ef89195e8aebd257e0c66 Mon Sep 17 00:00:00 2001 From: "Luke \"Jared\" Bennett" Date: Mon, 18 Sep 2017 12:36:27 +0100 Subject: [PATCH] Conditionally call loadCheck if lazyLoader is present --- app/assets/javascripts/issuable_context.js | 2 +- app/assets/javascripts/right_sidebar.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/issuable_context.js b/app/assets/javascripts/issuable_context.js index 0a8bab6ee66..9a9382a8d54 100644 --- a/app/assets/javascripts/issuable_context.js +++ b/app/assets/javascripts/issuable_context.js @@ -73,7 +73,7 @@ const PARTICIPANTS_ROW_COUNT = 7; $(".js-participants-hidden").toggle(); - gl.lazyLoader.loadCheck(); + if (gl.lazyLoader) gl.lazyLoader.loadCheck(); }; return IssuableContext; diff --git a/app/assets/javascripts/right_sidebar.js b/app/assets/javascripts/right_sidebar.js index c06b8b6efe6..7a987fe336b 100644 --- a/app/assets/javascripts/right_sidebar.js +++ b/app/assets/javascripts/right_sidebar.js @@ -47,8 +47,7 @@ import Cookies from 'js-cookie'; if (!triggered) { Cookies.set("collapsed_gutter", $('.right-sidebar').hasClass('right-sidebar-collapsed')); } - console.log('loadCheck') - gl.lazyLoader.loadCheck(); + if (gl.lazyLoader) gl.lazyLoader.loadCheck(); }); return $(document).off('click', '.js-issuable-todo').on('click', '.js-issuable-todo', this.toggleTodo); };