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.
// ... /////
$b24 = await initializeB24Frame()
// ... /////
const makeOpenSliderForUser = async(userId: number) =>
{
return $b24.slider.openPath(
$b24.slider.getUrl(`/company/personal/user/${userId}/`),
950
)
.then((response: StatusClose) =>
{
if(
!response.isOpenAtNewWindow
&& response.isClose
)
{
$logger.info("Slider is closed! Reinit the application")
return reloadData()
}
})
}
Methods
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://name.bitrix24.com).
openSliderAppPage
async openSliderAppPage(params: any = {}}: Promise<any>
Opens a slider with the application frame.
// ... /////
$b24 = await initializeB24Frame()
// ... /////
const makeOpenAppOptions = async() => {
return $b24.slider.openSliderAppPage(
{
place: 'app.options',
bx24_width: 650,
bx24_label: {
bgColor: 'violet',
text: '🛠️',
color: '#ffffff',
},
bx24_title: 'App Options',
}
)
}
closeSliderAppPage {#closeSliderAppPage}
async closeSliderAppPage(): Promise<void>
Closes the slider with the application.
// ... /////
$b24 = await initializeB24Frame()
// ... /////
const makeClosePage = async (): Promise<void> => {
return $b24.slider.closeSliderAppPage()
}
openPath {#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
// ... /////
$b24 = await initializeB24Frame()
// ... /////
const makeOpenSliderEditCurrency = async(currencyCode: string) =>
{
return $b24.slider.openPath(
$b24.slider.getUrl(`/crm/configs/currency/edit/${currencyCode}/`),
950
)
.then((response: StatusClose) =>
{
$logger.warn(response)
if(
!response.isOpenAtNewWindow
&& response.isClose
)
{
$logger.info("Slider is closed! Reinit the application")
return reloadData()
}
})
}
makeOpenSliderEditCurrency('INR')