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/sidebar/src/ |
Upload File : |
import {Core} from 'im.v2.application.core'; import {RecentList as RecentListComponent} from 'im.v2.component.old-chat-embedding.recent-list'; type SidebarApplicationParams = { node?: string | HTMLElement, preloadedList?: Object, loggerConfig?: Object } export class SidebarApplication { params: SidebarApplicationParams; inited: boolean = false; initPromise: Promise = null; initPromiseResolver: Function = null; rootNode: string | HTMLElement = null; vueInstance: Object = null; controller: Object = null; #applicationName = 'Sidebar'; constructor(params: SidebarApplicationParams = {}) { this.initPromise = new Promise((resolve) => { this.initPromiseResolver = resolve; }); this.params = params; this.rootNode = this.params.node || document.createElement('div'); this.initCore() .then(() => this.initComponent()) .then(() => this.initComplete()) ; } initCore() { return new Promise((resolve) => { Core.ready().then(controller => { this.controller = controller; resolve(); }); }); } initComponent() { return this.controller.createVue(this, { name: this.#applicationName, el: this.rootNode, components: {RecentListComponent}, template: `<RecentListComponent :compactMode="true"/>`, }) .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; } }