v1.1.0

Slider Manager Class

Provides methods for working with sliders in the Bitrix24 application. It allows opening and closing sliders, as well as managing their content.
We are still updating this page. Some data may be missing here — we will complete it shortly.

Methods

openSliderAppPage

async openSliderAppPage(params: any = {}}: Promise<any>

The openSliderAppPage method allows you to open the current app in a new slider, passing arbitrary parameters.

How it works:

  • Data Passing: You call the method and pass an object with parameters (e.g., place, action, or id).
  • Processing in the Application: On the application side, it's most convenient to intercept these parameters through middleware. This allows you to decide which route to display to the user before the page is rendered.
  • Seamless Navigation: The user sees a new slider with the desired content, while the redirection logic is hidden within the application.

closeSliderAppPage

async closeSliderAppPage(): Promise<void>

Closes the slider with the application.

openPath

async openPath(url: URL, width: number = 1640): Promise<StatusClose>

Opens the specified path inside the portal in a slider.

Handles errors related to mobile device usage and can open the URL in a new tab if the slider is not supported.

Returns StatusClose

ParameterTypeDescription
urlURLURL to be opened.
widthnumberSlider width, a number in the range from 1640 to 900.

This example demonstrates calling the Bitrix24 slider and handling its closing result.

Key points:

  • Completion handling: After closing the slider, the SDK returns a status. This allows subsequent operations to be initiated, such as reinitializing application data.
In some cases, Bitrix24 opens the interface not in the slider, but in a new browser tab.
  • Limitation: It is virtually impossible to detect the closing of an individual tab using standard JS tools.
  • Solution: The isOpenAtNewWindow parameter in the jsSdk response allows you to determine whether a tab was opened instead of the slider and correctly configure the application's logic.

getUrl

getUrl(path: string = '/'): URL

Returns a URL relative to the domain name and path.

$b24 = await initializeB24Frame()
// ...
const url = $b24.slider.getUrl('/settings/configs/userfield_list.php')

getTargetOrigin

getTargetOrigin(): string

Returns the Bitrix24 address (e.g., https://your_domain.bitrix24.com).