diff --git a/src/utils/AppendOptions.js b/src/utils/AppendOptions.js index 1a4bf00..c5a54de 100644 --- a/src/utils/AppendOptions.js +++ b/src/utils/AppendOptions.js @@ -1,4 +1,4 @@ -import { Ut } from "."; +import { Ut } from "./Ut"; export class AppendOptions { @@ -9,7 +9,7 @@ export class AppendOptions { if (opts.clear) { this.replaceChildren(); } - + Ut.each(Ut.isStr(data) ? JSON.parse(data) : data, (val, id) => target.append(new Option(val, id)) ); } } \ No newline at end of file diff --git a/src/widgets/popup/Popup.js b/src/widgets/popup/Popup.js index e1f4260..ed56555 100644 --- a/src/widgets/popup/Popup.js +++ b/src/widgets/popup/Popup.js @@ -145,9 +145,11 @@ export class Popup { */ setTitle(text) { - let title = this.card.toolbar.dxFind('h2.title'); + const title = this.card?.toolbar?.dxFind('h2.title'); - title.textContent = text; + if (!title) return; + + title.append(text); title.classList.remove('hide'); } @@ -158,7 +160,7 @@ export class Popup { if (this.opts.scrollBar) { this.card.container.dxCss('max-height', - ( window.innerHeight - this.card.toolbar.clientHeight - this.opts.marginTop - this.opts.marginBottom ) + ( window.innerHeight - (this.card?.toolbar?.clientHeight || 0) - this.opts.marginTop - this.opts.marginBottom ) + 'px' ); }