From 58152244ea0e07a877dc31f23013bfecddbdc6df Mon Sep 17 00:00:00 2001 From: colemanw <coleman@civicrm.org> Date: Sat, 25 May 2019 15:15:19 -0400 Subject: [PATCH] dev/core#968 Fix javascript error on public pages Checks for the existence of the toolbar item before referencing it. --- js/crm.drupal8.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/crm.drupal8.js b/js/crm.drupal8.js index 74e64cb779..ea8dadd79f 100644 --- a/js/crm.drupal8.js +++ b/js/crm.drupal8.js @@ -5,7 +5,7 @@ localStorage.setItem('Drupal.toolbar.activeTabID', JSON.stringify('toolbar-item- (function($) { function adjustToggle() { - if ($(window).width() < 768) { + if ($(window).width() < 768 && $('#toolbar-item-civicrm').length) { $('#civicrm-menu-nav .crm-menubar-toggle-btn').css({ left: '' + $('#toolbar-item-civicrm').offset().left + 'px', width: '' + $('#toolbar-item-civicrm').innerWidth() + 'px' -- 2.25.1