Version 1.0.1 is now available! Looking for a migration guide?
v1.0.1
/
  • Get Started
  • Working
  • GitHub
  • Overview
  • Introduction
  • Actions
  • Call
  • Call
  • CallList
  • CallList
  • FetchList
  • FetchList
  • Batch
  • Batch
  • BatchByChunk
  • BatchByChunk
  • Tools
  • HealthCheck
  • Ping
  • Logger
  • Logger
  • Telegram
  • Limiters
  • Limiters
  • B24Frame
  • Introduction
  • Initialization
  • Auth
  • Dialog
  • Options
  • Parent
  • Placement
  • Slider
  • b24ui
  • b24icons
v1.0.1
  • Get started
  • Working

Parent Manager Class

Provides methods for managing the parent application window in Bitrix24, including resizing the window, managing scroll, initiating calls, and opening the messenger.
We are still updating this page. Some data may be missing here — we will complete it shortly.
// ... /////
$b24 = await initializeB24Frame()
// ... /////
await $b24.parent.fitWindow()

Methods

closeApplication

async closeApplication(): Promise<void>

Closes the application slider.

fitWindow

async fitWindow(): Promise<any>

Sets the application frame size according to its content size.

resizeWindow

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

Resizes the application frame to the specified width and height.

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.

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

getScrollSize

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

Returns the internal dimensions of the application frame.

scrollParentWindow

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

Scrolls the parent window to the specified position.

reloadWindow

async reloadWindow(): Promise<void>

Reloads the application page.

setTitle

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

Sets the page title.

imCallTo

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

Initiates a call through internal communication.

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

imPhoneTo

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

Makes a call to the specified phone number.

ParameterTypeDescription
phonestringPhone number.

imOpenMessenger

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

Opens the messenger window.

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

imOpenHistory

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

Opens the message history window.

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

Examples

Try call

frame-parent-call.ts
import type { B24Frame } from '@bitrix24/b24jssdk'
import { Text, LoggerFactory, Logger, ConsoleV2Handler, LogLevel } from '@bitrix24/b24jssdk'


const devMode = typeof import.meta !== 'undefined' && (import.meta?.dev || globalThis._importMeta_.env?.DEV)
const $logger = LoggerFactory.createForBrowser('Example:B24FrameParentCall', devMode)
const $b24 = useB24().get() as B24Frame

const loggerForDebugB24 = Logger.create('b24')
const handlerForDebugB24 = new ConsoleV2Handler(LogLevel.DEBUG, { useStyles: true })
loggerForDebugB24.pushHandler(handlerForDebugB24)

$b24.setLogger(loggerForDebugB24)

const response = await $b24.parent.message.send(
  'setTitle',
  {
    title: 'Text for insertion',
    requestId: Text.getUuidRfc4122(),
    isSafely: true,
    safelyTime: 1500
  }
)

$logger.debug('parent response', {
  response
})

Options

Used for managing application and user settings in the Bitrix24 application. It allows initializing data, getting, and setting options through messages to the parent window.

Placement

Used for managing the placement of widgets in the Bitrix24 application.

On this page

  • Methods
    • closeApplication
    • fitWindow
    • resizeWindow
    • resizeWindowAuto
    • getScrollSize
    • scrollParentWindow
    • reloadWindow
    • setTitle
    • imCallTo
    • imPhoneTo
    • imOpenMessenger
    • imOpenHistory
  • Examples
    • Try call
Releases
Published under MIT License.

Copyright © 2024-present Bitrix24