Skip to content

ParentManager Class

Provides methods for managing the parent application window in Bitrix24, including resizing the window, managing scroll, initiating calls, and opening the messenger.

ts
// ... /////
$b24 = await initializeB24Frame()
// ... /////
await $b24.parent.fitWindow()

TIP

You can test working with B24Frame.parent in this example.

Methods

closeApplication

ts
async closeApplication(): Promise<void>

Closes the application slider. Similar to function

fitWindow

ts
async fitWindow(): Promise<any>

Sets the application frame size according to its content size. Similar to function

resizeWindow

ts
async resizeWindow(
	width: number,
	height: number
): Promise<void>

Resizes the application frame to the specified width and height. Similar to function

resizeWindowAuto

ts
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.

ParameterTypeDescription
appNodenull|HTMLElementApplication node for height calculation.
minHeightnumberMinimum height.
minWidthnumberMinimum width.

getScrollSize

ts
getScrollSize(): {
	scrollWidth: number,
	scrollHeight: number
}

Returns the internal dimensions of the application frame. Similar to function

scrollParentWindow

ts
async scrollParentWindow(scroll: number): Promise<void>

Scrolls the parent window to the specified position. Similar to function

reloadWindow

ts
async reloadWindow(): Promise<void>

Reloads the application page. Similar to function

setTitle

ts
async setTitle(
	title: string
): Promise<void>

Sets the page title. Similar to function

imCallTo

ts
async imCallTo(
	userId: number,
	isVideo: boolean = true
): Promise<void>

Initiates a call through internal communication. Similar to function

ParameterTypeDescription
userIdnumberUser identifier.
isVideobooleantrue for video call, false for audio call.

imPhoneTo

ts
async imPhoneTo(
	phone: string
): Promise<void>

Makes a call to the specified phone number. Similar to function

ParameterTypeDescription
phonestringPhone number.

imOpenMessenger

ts
async imOpenMessenger(
	dialogId: number|'chat${number}'|'sg${number}'|'imol|${number}'|undefined
): Promise<void>

Opens the messenger window. Similar to function

ParameterTypeDescription
dialogIdnumber|chat${number}|sg${number}|imol|${number}|undefinedDialog identifier.

imOpenHistory

ts
async imOpenHistory(
	dialogId: number|'chat${number}'|'imol|${number}'
): Promise<void>

Opens the message history window. Similar to function

ParameterTypeDescription
dialogIdnumber|chat${number}|imol|${number}Dialog identifier.

Released under the MIT License.