ParentManager Class
Provides methods for managing the parent application window in Bitrix24, including resizing the window, managing scroll, initiating calls, and opening the messenger.
// ... /////
$b24 = await initializeB24Frame()
// ... /////
await $b24.parent.fitWindow()TIP
You can test working with B24Frame.parent in this example.
Methods
closeApplication
async closeApplication(): Promise<void>Closes the application slider. Similar to function
fitWindow
async fitWindow(): Promise<any>Sets the application frame size according to its content size. Similar to function
resizeWindow
async resizeWindow(
width: number,
height: number
): Promise<void>Resizes the application frame to the specified width and height. Similar to function
resizeWindowAuto
async resizeWindowAuto(
appNode: null|HTMLElement = null,
minHeight: number = 0,
minWidth: number = 0
): Promise<void>Automatically resizes the document.body of the application frame according to its content size.
| Parameter | Type | Description |
|---|---|---|
appNode | null|HTMLElement | Application node for height calculation. |
minHeight | number | Minimum height. |
minWidth | number | Minimum width. |
getScrollSize
getScrollSize(): {
scrollWidth: number,
scrollHeight: number
}Returns the internal dimensions of the application frame. Similar to function
scrollParentWindow
async scrollParentWindow(scroll: number): Promise<void>Scrolls the parent window to the specified position. Similar to function
reloadWindow
async reloadWindow(): Promise<void>Reloads the application page. Similar to function
setTitle
async setTitle(
title: string
): Promise<void>Sets the page title. Similar to function
imCallTo
async imCallTo(
userId: number,
isVideo: boolean = true
): Promise<void>Initiates a call through internal communication. Similar to function
| Parameter | Type | Description |
|---|---|---|
userId | number | User identifier. |
isVideo | boolean | true for video call, false for audio call. |
imPhoneTo
async imPhoneTo(
phone: string
): Promise<void>Makes a call to the specified phone number. Similar to function
| Parameter | Type | Description |
|---|---|---|
phone | string | Phone number. |
imOpenMessenger
async imOpenMessenger(
dialogId: number|'chat${number}'|'sg${number}'|'imol|${number}'|undefined
): Promise<void>Opens the messenger window. Similar to function
| Parameter | Type | Description |
|---|---|---|
dialogId | number|chat${number}|sg${number}|imol|${number}|undefined | Dialog identifier. |
imOpenHistory
async imOpenHistory(
dialogId: number|'chat${number}'|'imol|${number}'
): Promise<void>Opens the message history window. Similar to function
| Parameter | Type | Description |
|---|---|---|
dialogId | number|chat${number}|imol|${number} | Dialog identifier. |