Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/im/v2/application/left-panel/src/ |
Upload File : |
import {Core} from 'im.v2.application.core'; import {LeftPanel as LeftPanelComponent} from 'im.v2.component.old-chat-embedding.left-panel'; type LeftPanelApplicationParams = { node?: string | HTMLElement, preloadedList?: Object } export class LeftPanelApplication { params: LeftPanelApplicationParams; inited: boolean = false; initPromise: Promise = null; initPromiseResolver: Function = null; rootNode: string | HTMLElement = null; vueInstance: Object = null; controller: Object = null; bitrixVue: Object = null; #applicationName = 'LeftPanel'; constructor(params: LeftPanelApplicationParams = {}) { this.initPromise = new Promise((resolve) => { this.initPromiseResolver = resolve; }); this.params = params; this.rootNode = this.params.node || document.createElement('div'); this.initCore().then(() => this.initComplete()); } initCore() { return new Promise((resolve) => { Core.ready().then(controller => { this.controller = controller; resolve(); }); }); } initComponent(node) { if (this.vueInstance) { this.bitrixVue.unmount(); this.vueInstance = null; } return this.controller.createVue(this, { name: this.#applicationName, el: node, components: {LeftPanelComponent}, template: `<LeftPanelComponent />`, }) .then(vue => { this.vueInstance = vue; return Promise.resolve(); }); } initComplete() { this.inited = true; this.initPromiseResolver(this); } ready() { if (this.inited) { return Promise.resolve(this); } return this.initPromise; } }