add-to-calendar-button 2.5.1 → 2.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Style: 3D
7
7
  *
8
- * Version: 2.5.1
8
+ * Version: 2.5.3
9
9
  * Creator: Jens Kuerschner (https://jenskuerschner.de)
10
10
  * Project: https://github.com/add2cal/add-to-calendar-button
11
11
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Style: Date
7
7
  *
8
- * Version: 2.5.1
8
+ * Version: 2.5.3
9
9
  * Creator: Jens Kuerschner (https://jenskuerschner.de)
10
10
  * Project: https://github.com/add2cal/add-to-calendar-button
11
11
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Style: Flat
7
7
  *
8
- * Version: 2.5.1
8
+ * Version: 2.5.3
9
9
  * Creator: Jens Kuerschner (https://jenskuerschner.de)
10
10
  * Project: https://github.com/add2cal/add-to-calendar-button
11
11
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Style: Neumorphism
7
7
  *
8
- * Version: 2.5.1
8
+ * Version: 2.5.3
9
9
  * Creator: Jens Kuerschner (https://jenskuerschner.de)
10
10
  * Project: https://github.com/add2cal/add-to-calendar-button
11
11
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Style: Round
7
7
  *
8
- * Version: 2.5.1
8
+ * Version: 2.5.3
9
9
  * Creator: Jens Kuerschner (https://jenskuerschner.de)
10
10
  * Project: https://github.com/add2cal/add-to-calendar-button
11
11
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Style: Text
7
7
  *
8
- * Version: 2.5.1
8
+ * Version: 2.5.3
9
9
  * Creator: Jens Kuerschner (https://jenskuerschner.de)
10
10
  * Project: https://github.com/add2cal/add-to-calendar-button
11
11
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Style: Default
7
7
  *
8
- * Version: 2.5.1
8
+ * Version: 2.5.3
9
9
  * Creator: Jens Kuerschner (https://jenskuerschner.de)
10
10
  * Project: https://github.com/add2cal/add-to-calendar-button
11
11
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -977,14 +977,14 @@ function tzlib_get_timezones(jsonType = false) {
977
977
  * Add to Calendar Button
978
978
  * ++++++++++++++++++++++
979
979
  *
980
- * Version: 2.5.1
980
+ * Version: 2.5.3
981
981
  * Creator: Jens Kuerschner (https://jenskuerschner.de)
982
982
  * Project: https://github.com/add2cal/add-to-calendar-button
983
983
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
984
984
  * Note: DO NOT REMOVE THE COPYRIGHT NOTICE ABOVE!
985
985
  *
986
986
  */
987
- const atcbVersion = '2.5.1';
987
+ const atcbVersion = '2.5.3';
988
988
  const atcbCssTemplate = {};
989
989
  const atcbIsBrowser = () => {
990
990
  if (typeof window === 'undefined') {
@@ -1998,7 +1998,7 @@ function atcb_toggle(host, action, data = '', button = null, keyboardTrigger = f
1998
1998
  atcb_open(host, data, button, keyboardTrigger, generatedButton);
1999
1999
  }
2000
2000
  }
2001
- function atcb_open(host, data, button = null, keyboardTrigger = false, generatedButton = false) {
2001
+ async function atcb_open(host, data, button = null, keyboardTrigger = false, generatedButton = false) {
2002
2002
  if (host.querySelector('.atcb-list') || host.querySelector('.atcb-modal')) return;
2003
2003
  atcb_log_event('openList', data.identifier, data.identifier);
2004
2004
  atcbStates['active'] = data.identifier;
@@ -2029,7 +2029,7 @@ function atcb_open(host, data, button = null, keyboardTrigger = false, generated
2029
2029
  }
2030
2030
  const bgOverlay = atcb_generate_bg_overlay(host, data.trigger, data.listStyle === 'modal', !data.hideBackground);
2031
2031
  if (data.listStyle === 'modal') {
2032
- const modalHost = atcb_generate_modal_host(host, data);
2032
+ const modalHost = await atcb_generate_modal_host(host, data);
2033
2033
  modalHost.querySelector('.atcb-modal-host-initialized').append(bgOverlay);
2034
2034
  bgOverlay.append(list);
2035
2035
  if (!data.hideBranding) {
@@ -2481,9 +2481,9 @@ function atcb_create_atcbl(host, atList = true, returnEl = false) {
2481
2481
  }
2482
2482
  }
2483
2483
  }
2484
- function atcb_create_modal(host, data, icon = '', headline, content = '', buttons = [], subEvents = [], keyboardTrigger = false, goto = {}, closable = true) {
2484
+ async function atcb_create_modal(host, data, icon = '', headline, content = '', buttons = [], subEvents = [], keyboardTrigger = false, goto = {}, closable = true) {
2485
2485
  atcbStates['active'] = data.identifier;
2486
- const modalHost = atcb_generate_modal_host(host, data, false);
2486
+ const modalHost = await atcb_generate_modal_host(host, data, false);
2487
2487
  const bgOverlay = (function () {
2488
2488
  const el = modalHost.getElementById('atcb-bgoverlay');
2489
2489
  if (!el) {
@@ -2659,7 +2659,7 @@ function atcb_create_modal(host, data, icon = '', headline, content = '', button
2659
2659
  });
2660
2660
  if (modalCount > 1) {
2661
2661
  const prevModal = modalHost.querySelector('.atcb-modal[data-modal-nr="' + (modalCount - 1) + '"]');
2662
- prevModal.style.display = 'none';
2662
+ prevModal.classList.add('atcb-hidden');
2663
2663
  }
2664
2664
  atcb_manage_body_scroll(modalHost, modalWrapper);
2665
2665
  }
@@ -2814,7 +2814,7 @@ function atcb_generate_date_button(data, parent, subEvent = 'all') {
2814
2814
  parent.append(btnCheck);
2815
2815
  }
2816
2816
  }
2817
- function atcb_generate_modal_host(host, data, reset = true) {
2817
+ async function atcb_generate_modal_host(host, data, reset = true) {
2818
2818
  const existingModalHost = document.getElementById(data.identifier + '-modal-host');
2819
2819
  if (!reset && existingModalHost) {
2820
2820
  return existingModalHost.shadowRoot;
@@ -2824,12 +2824,6 @@ function atcb_generate_modal_host(host, data, reset = true) {
2824
2824
  }
2825
2825
  let newModalHost = document.createElement('div');
2826
2826
  newModalHost.id = data.identifier + '-modal-host';
2827
- if (data.styleLight) {
2828
- newModalHost.setAttribute('styleLight', data.styleLight);
2829
- }
2830
- if (data.styleDark) {
2831
- newModalHost.setAttribute('styleDark', data.styleDark);
2832
- }
2833
2827
  if (host.host.hasAttribute('cspnonce')) {
2834
2828
  newModalHost.setAttribute('cspnonce', host.host.getAttribute('cspnonce'));
2835
2829
  }
@@ -2838,14 +2832,14 @@ function atcb_generate_modal_host(host, data, reset = true) {
2838
2832
  document.body.append(newModalHost);
2839
2833
  newModalHost.attachShadow({ mode: 'open', delegateFocus: true });
2840
2834
  const elem = document.createElement('template');
2841
- elem.innerHTML = '<div class="atcb-modal-host-initialized" style="translate3D(0, 0, 0);visibility:visible;opacity:1;position:fixed;top:0;left:0;width:100%;height:100%;display:flex;z-index:13999999;"></div>';
2835
+ elem.innerHTML = '<div class="atcb-modal-host-initialized" style="transform:translate3D(0, 0, 0);visibility:visible;opacity:1;position:fixed;top:0;left:0;width:100%;height:100%;display:flex;z-index:13999999;"></div>';
2842
2836
  newModalHost.shadowRoot.append(elem.content.cloneNode(true));
2843
2837
  atcb_set_light_mode(newModalHost.shadowRoot, data);
2844
- atcb_load_css(newModalHost.shadowRoot, null, data);
2838
+ await atcb_load_css(newModalHost.shadowRoot, null, data);
2845
2839
  return newModalHost.shadowRoot;
2846
2840
  }
2847
- function atcb_generate_overlay_dom(host, data) {
2848
- const newHost = atcb_generate_modal_host(host, data);
2841
+ async function atcb_generate_overlay_dom(host, data) {
2842
+ const newHost = await atcb_generate_modal_host(host, data);
2849
2843
  atcb_set_fullsize(newHost.querySelector('.atcb-modal-host-initialized'));
2850
2844
  const nodes = Array.from(host.children);
2851
2845
  nodes.forEach((node) => {
@@ -3634,7 +3628,8 @@ function atcb_format_datetime(datetime, style = 'delimiters', includeTime = true
3634
3628
  }
3635
3629
  function atcb_generate_timestring(dates, language = 'en', subEvent = 'all', decorate = false, browserTimeOverride = false, enforceYear = false, hideTimeZone = false) {
3636
3630
  if (decorate) {
3637
- dates = atcb_decorate_data_dates({ dates: dates }).dates;
3631
+ const tmpRootTZ = atcb_decorate_data_timezone();
3632
+ dates = atcb_decorate_data_dates({ dates: dates, timeZone: tmpRootTZ }).dates;
3638
3633
  }
3639
3634
  let startDateInfo, endDateInfo, timeZoneInfoStart, timeZoneInfoEnd;
3640
3635
  let formattedTimeStart = {};
@@ -5210,7 +5205,7 @@ function atcb_csp_nonce(host) {
5210
5205
  }
5211
5206
  return host.host.getAttribute('cspnonce');
5212
5207
  }
5213
- function atcb_load_css(host, rootObj = null, data) {
5208
+ async function atcb_load_css(host, rootObj = null, data) {
5214
5209
  const nonceVal = atcb_csp_nonce(host);
5215
5210
  if (!document.getElementById('atcb-global-style')) {
5216
5211
  const cssGlobalContent = document.createElement('style');
@@ -5249,9 +5244,8 @@ function atcb_load_css(host, rootObj = null, data) {
5249
5244
  if (nonceVal) {
5250
5245
  cssFile.setAttribute('nonce', nonceVal);
5251
5246
  }
5252
- if (rootObj == null) {
5253
- host.host.style.display = 'none';
5254
- loadExternalCssAsynch(cssFile, host, host.host, nonceVal);
5247
+ if (!rootObj) {
5248
+ await loadExternalCssAsynch(cssFile, host, null, nonceVal, null, false, false, overrideDefaultCss + overrideDarkCss);
5255
5249
  } else {
5256
5250
  const placeholder = document.createElement('div');
5257
5251
  placeholder.classList.add('atcb-placeholder');
@@ -5266,7 +5260,7 @@ function atcb_load_css(host, rootObj = null, data) {
5266
5260
  }
5267
5261
  return;
5268
5262
  }
5269
- if (data.buttonStyle !== 'none' && atcbCssTemplate[`${data.buttonStyle}`] != null) {
5263
+ if (data.buttonStyle !== 'none' && atcbCssTemplate[`${data.buttonStyle}`]) {
5270
5264
  const cssContent = document.createElement('style');
5271
5265
  if (nonceVal) {
5272
5266
  cssContent.setAttribute('nonce', nonceVal);
@@ -5274,7 +5268,7 @@ function atcb_load_css(host, rootObj = null, data) {
5274
5268
  cssContent.innerText = atcbCssTemplate[`${data.buttonStyle}`] + overrideDefaultCss + overrideDarkCss;
5275
5269
  host.prepend(cssContent);
5276
5270
  }
5277
- if (rootObj != null) {
5271
+ if (rootObj) {
5278
5272
  if (data.inline) {
5279
5273
  rootObj.style.display = 'inline-block';
5280
5274
  rootObj.classList.add('atcb-inline');
@@ -5286,7 +5280,7 @@ function atcb_load_css(host, rootObj = null, data) {
5286
5280
  rootObj.classList.remove('atcb-hidden');
5287
5281
  }
5288
5282
  }
5289
- async function loadExternalCssAsynch(cssFile, host, rootObj, nonceVal = null, placeholder = null, inline = false, buttonsList = false, overrideCss = '') {
5283
+ async function loadExternalCssAsynch(cssFile, host, rootObj = null, nonceVal = null, placeholder = null, inline = false, buttonsList = false, overrideCss = '') {
5290
5284
  if (overrideCss !== '') {
5291
5285
  const cssContent = document.createElement('style');
5292
5286
  cssContent.innerText = overrideCss;
@@ -5300,18 +5294,20 @@ async function loadExternalCssAsynch(cssFile, host, rootObj, nonceVal = null, pl
5300
5294
  await new Promise((resolve) => {
5301
5295
  cssFile.onload = resolve;
5302
5296
  });
5303
- if (placeholder) {
5304
- placeholder.remove();
5305
- }
5306
- if (inline) {
5307
- rootObj.style.display = 'inline-block';
5308
- rootObj.classList.add('atcb-inline');
5309
- } else {
5310
- if (buttonsList) {
5311
- rootObj.classList.add('atcb-buttons-list');
5297
+ if (rootObj) {
5298
+ if (placeholder) {
5299
+ placeholder.remove();
5312
5300
  }
5301
+ if (inline) {
5302
+ rootObj.style.display = 'inline-block';
5303
+ rootObj.classList.add('atcb-inline');
5304
+ } else {
5305
+ if (buttonsList) {
5306
+ rootObj.classList.add('atcb-buttons-list');
5307
+ }
5308
+ }
5309
+ rootObj.classList.remove('atcb-hidden');
5313
5310
  }
5314
- rootObj.classList.remove('atcb-hidden');
5315
5311
  } catch (e) {
5316
5312
  console.log(e);
5317
5313
  }
@@ -977,14 +977,14 @@ function tzlib_get_timezones(jsonType = false) {
977
977
  * Add to Calendar Button
978
978
  * ++++++++++++++++++++++
979
979
  *
980
- * Version: 2.5.1
980
+ * Version: 2.5.3
981
981
  * Creator: Jens Kuerschner (https://jenskuerschner.de)
982
982
  * Project: https://github.com/add2cal/add-to-calendar-button
983
983
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
984
984
  * Note: DO NOT REMOVE THE COPYRIGHT NOTICE ABOVE!
985
985
  *
986
986
  */
987
- const atcbVersion = '2.5.1';
987
+ const atcbVersion = '2.5.3';
988
988
  const atcbCssTemplate = {
989
989
  if (typeof window === 'undefined') {
990
990
  return false;
@@ -1997,7 +1997,7 @@ function atcb_toggle(host, action, data = '', button = null, keyboardTrigger = f
1997
1997
  atcb_open(host, data, button, keyboardTrigger, generatedButton);
1998
1998
  }
1999
1999
  }
2000
- function atcb_open(host, data, button = null, keyboardTrigger = false, generatedButton = false) {
2000
+ async function atcb_open(host, data, button = null, keyboardTrigger = false, generatedButton = false) {
2001
2001
  if (host.querySelector('.atcb-list') || host.querySelector('.atcb-modal')) return;
2002
2002
  atcb_log_event('openList', data.identifier, data.identifier);
2003
2003
  atcbStates['active'] = data.identifier;
@@ -2028,7 +2028,7 @@ function atcb_open(host, data, button = null, keyboardTrigger = false, generated
2028
2028
  }
2029
2029
  const bgOverlay = atcb_generate_bg_overlay(host, data.trigger, data.listStyle === 'modal', !data.hideBackground);
2030
2030
  if (data.listStyle === 'modal') {
2031
- const modalHost = atcb_generate_modal_host(host, data);
2031
+ const modalHost = await atcb_generate_modal_host(host, data);
2032
2032
  modalHost.querySelector('.atcb-modal-host-initialized').append(bgOverlay);
2033
2033
  bgOverlay.append(list);
2034
2034
  if (!data.hideBranding) {
@@ -2480,9 +2480,9 @@ function atcb_create_atcbl(host, atList = true, returnEl = false) {
2480
2480
  }
2481
2481
  }
2482
2482
  }
2483
- function atcb_create_modal(host, data, icon = '', headline, content = '', buttons = [], subEvents = [], keyboardTrigger = false, goto = {}, closable = true) {
2483
+ async function atcb_create_modal(host, data, icon = '', headline, content = '', buttons = [], subEvents = [], keyboardTrigger = false, goto = {}, closable = true) {
2484
2484
  atcbStates['active'] = data.identifier;
2485
- const modalHost = atcb_generate_modal_host(host, data, false);
2485
+ const modalHost = await atcb_generate_modal_host(host, data, false);
2486
2486
  const bgOverlay = (function () {
2487
2487
  const el = modalHost.getElementById('atcb-bgoverlay');
2488
2488
  if (!el) {
@@ -2658,7 +2658,7 @@ function atcb_create_modal(host, data, icon = '', headline, content = '', button
2658
2658
  });
2659
2659
  if (modalCount > 1) {
2660
2660
  const prevModal = modalHost.querySelector('.atcb-modal[data-modal-nr="' + (modalCount - 1) + '"]');
2661
- prevModal.style.display = 'none';
2661
+ prevModal.classList.add('atcb-hidden');
2662
2662
  }
2663
2663
  atcb_manage_body_scroll(modalHost, modalWrapper);
2664
2664
  }
@@ -2813,7 +2813,7 @@ function atcb_generate_date_button(data, parent, subEvent = 'all') {
2813
2813
  parent.append(btnCheck);
2814
2814
  }
2815
2815
  }
2816
- function atcb_generate_modal_host(host, data, reset = true) {
2816
+ async function atcb_generate_modal_host(host, data, reset = true) {
2817
2817
  const existingModalHost = document.getElementById(data.identifier + '-modal-host');
2818
2818
  if (!reset && existingModalHost) {
2819
2819
  return existingModalHost.shadowRoot;
@@ -2823,12 +2823,6 @@ function atcb_generate_modal_host(host, data, reset = true) {
2823
2823
  }
2824
2824
  let newModalHost = document.createElement('div');
2825
2825
  newModalHost.id = data.identifier + '-modal-host';
2826
- if (data.styleLight) {
2827
- newModalHost.setAttribute('styleLight', data.styleLight);
2828
- }
2829
- if (data.styleDark) {
2830
- newModalHost.setAttribute('styleDark', data.styleDark);
2831
- }
2832
2826
  if (host.host.hasAttribute('cspnonce')) {
2833
2827
  newModalHost.setAttribute('cspnonce', host.host.getAttribute('cspnonce'));
2834
2828
  }
@@ -2837,14 +2831,14 @@ function atcb_generate_modal_host(host, data, reset = true) {
2837
2831
  document.body.append(newModalHost);
2838
2832
  newModalHost.attachShadow({ mode: 'open', delegateFocus: true });
2839
2833
  const elem = document.createElement('template');
2840
- elem.innerHTML = '<div class="atcb-modal-host-initialized" style="translate3D(0, 0, 0);visibility:visible;opacity:1;position:fixed;top:0;left:0;width:100%;height:100%;display:flex;z-index:13999999;"></div>';
2834
+ elem.innerHTML = '<div class="atcb-modal-host-initialized" style="transform:translate3D(0, 0, 0);visibility:visible;opacity:1;position:fixed;top:0;left:0;width:100%;height:100%;display:flex;z-index:13999999;"></div>';
2841
2835
  newModalHost.shadowRoot.append(elem.content.cloneNode(true));
2842
2836
  atcb_set_light_mode(newModalHost.shadowRoot, data);
2843
- atcb_load_css(newModalHost.shadowRoot, null, data);
2837
+ await atcb_load_css(newModalHost.shadowRoot, null, data);
2844
2838
  return newModalHost.shadowRoot;
2845
2839
  }
2846
- function atcb_generate_overlay_dom(host, data) {
2847
- const newHost = atcb_generate_modal_host(host, data);
2840
+ async function atcb_generate_overlay_dom(host, data) {
2841
+ const newHost = await atcb_generate_modal_host(host, data);
2848
2842
  atcb_set_fullsize(newHost.querySelector('.atcb-modal-host-initialized'));
2849
2843
  const nodes = Array.from(host.children);
2850
2844
  nodes.forEach((node) => {
@@ -3633,7 +3627,8 @@ function atcb_format_datetime(datetime, style = 'delimiters', includeTime = true
3633
3627
  }
3634
3628
  function atcb_generate_timestring(dates, language = 'en', subEvent = 'all', decorate = false, browserTimeOverride = false, enforceYear = false, hideTimeZone = false) {
3635
3629
  if (decorate) {
3636
- dates = atcb_decorate_data_dates({ dates: dates }).dates;
3630
+ const tmpRootTZ = atcb_decorate_data_timezone();
3631
+ dates = atcb_decorate_data_dates({ dates: dates, timeZone: tmpRootTZ }).dates;
3637
3632
  }
3638
3633
  let startDateInfo, endDateInfo, timeZoneInfoStart, timeZoneInfoEnd;
3639
3634
  let formattedTimeStart = {};
@@ -5209,7 +5204,7 @@ function atcb_csp_nonce(host) {
5209
5204
  }
5210
5205
  return host.host.getAttribute('cspnonce');
5211
5206
  }
5212
- function atcb_load_css(host, rootObj = null, data) {
5207
+ async function atcb_load_css(host, rootObj = null, data) {
5213
5208
  const nonceVal = atcb_csp_nonce(host);
5214
5209
  if (!document.getElementById('atcb-global-style')) {
5215
5210
  const cssGlobalContent = document.createElement('style');
@@ -5248,9 +5243,8 @@ function atcb_load_css(host, rootObj = null, data) {
5248
5243
  if (nonceVal) {
5249
5244
  cssFile.setAttribute('nonce', nonceVal);
5250
5245
  }
5251
- if (rootObj == null) {
5252
- host.host.style.display = 'none';
5253
- loadExternalCssAsynch(cssFile, host, host.host, nonceVal);
5246
+ if (!rootObj) {
5247
+ await loadExternalCssAsynch(cssFile, host, null, nonceVal, null, false, false, overrideDefaultCss + overrideDarkCss);
5254
5248
  } else {
5255
5249
  const placeholder = document.createElement('div');
5256
5250
  placeholder.classList.add('atcb-placeholder');
@@ -5265,7 +5259,7 @@ function atcb_load_css(host, rootObj = null, data) {
5265
5259
  }
5266
5260
  return;
5267
5261
  }
5268
- if (data.buttonStyle !== 'none' && atcbCssTemplate[`${data.buttonStyle}`] != null) {
5262
+ if (data.buttonStyle !== 'none' && atcbCssTemplate[`${data.buttonStyle}`]) {
5269
5263
  const cssContent = document.createElement('style');
5270
5264
  if (nonceVal) {
5271
5265
  cssContent.setAttribute('nonce', nonceVal);
@@ -5273,7 +5267,7 @@ function atcb_load_css(host, rootObj = null, data) {
5273
5267
  cssContent.innerText = atcbCssTemplate[`${data.buttonStyle}`] + overrideDefaultCss + overrideDarkCss;
5274
5268
  host.prepend(cssContent);
5275
5269
  }
5276
- if (rootObj != null) {
5270
+ if (rootObj) {
5277
5271
  if (data.inline) {
5278
5272
  rootObj.style.display = 'inline-block';
5279
5273
  rootObj.classList.add('atcb-inline');
@@ -5285,7 +5279,7 @@ function atcb_load_css(host, rootObj = null, data) {
5285
5279
  rootObj.classList.remove('atcb-hidden');
5286
5280
  }
5287
5281
  }
5288
- async function loadExternalCssAsynch(cssFile, host, rootObj, nonceVal = null, placeholder = null, inline = false, buttonsList = false, overrideCss = '') {
5282
+ async function loadExternalCssAsynch(cssFile, host, rootObj = null, nonceVal = null, placeholder = null, inline = false, buttonsList = false, overrideCss = '') {
5289
5283
  if (overrideCss !== '') {
5290
5284
  const cssContent = document.createElement('style');
5291
5285
  cssContent.innerText = overrideCss;
@@ -5299,18 +5293,20 @@ async function loadExternalCssAsynch(cssFile, host, rootObj, nonceVal = null, pl
5299
5293
  await new Promise((resolve) => {
5300
5294
  cssFile.onload = resolve;
5301
5295
  });
5302
- if (placeholder) {
5303
- placeholder.remove();
5304
- }
5305
- if (inline) {
5306
- rootObj.style.display = 'inline-block';
5307
- rootObj.classList.add('atcb-inline');
5308
- } else {
5309
- if (buttonsList) {
5310
- rootObj.classList.add('atcb-buttons-list');
5296
+ if (rootObj) {
5297
+ if (placeholder) {
5298
+ placeholder.remove();
5311
5299
  }
5300
+ if (inline) {
5301
+ rootObj.style.display = 'inline-block';
5302
+ rootObj.classList.add('atcb-inline');
5303
+ } else {
5304
+ if (buttonsList) {
5305
+ rootObj.classList.add('atcb-buttons-list');
5306
+ }
5307
+ }
5308
+ rootObj.classList.remove('atcb-hidden');
5312
5309
  }
5313
- rootObj.classList.remove('atcb-hidden');
5314
5310
  } catch (e) {
5315
5311
  console.log(e);
5316
5312
  }