403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/catalog/config/settings/src/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/catalog/config/settings/src/slider.js
import { ModeList } from 'catalog.store-enable-wizard';
import { Type } from 'main.core';
import { EventEmitter } from 'main.core.events';

export default class Slider
{
	static URL = '/crm/configs/catalog/';
	static URL_RIGHTS = '/shop/settings/permissions/';

	static open(source = null, options = {}): Promise
	{
		Slider.closePopup();
		let url = Slider.URL;
		if (Type.isStringFilled(source))
		{
			url += `?configCatalogSource=${source}`;
		}

		EventEmitter.subscribe('SidePanel.Slider:onMessage', (event) => {
			const [data] = event.getData();

			if (data.eventId === 'BX.Crm.Config.Catalog:onAfterSaveSettings')
			{
				EventEmitter.emit(window, 'onCatalogSettingsSave');
			}
		});

		if (!options.events)
		{
			options.events = {};
		}

		if (!options.events.onClose)
		{
			options.events.onClose = (event) => {
				if (event.getSlider()?.getData().get('isInventoryManagementChanged'))
				{
					if (event.getSlider().getData().get('inventoryManagementMode') === ModeList.MODE_1C)
					{
						top.document.location = '/crm/';
					}
					else
					{
						document.location.reload();
					}
				}
			};
		}

		return new Promise((resolve) => {
			BX.SidePanel.Instance.open(
				url,
				{
					width: 1000,
					allowChangeHistory: false,
					cacheable: false,
					...options,
				},
			);
		});
	}

	static openRigthsSlider(): Promise
	{
		Slider.closePopup();

		return new Promise((resolve) => {
			BX.SidePanel.Instance.open(
				Slider.URL_RIGHTS,
				{},
			);
		});
	}

	static openSeoSlider(url :string): Promise
	{
		Slider.closePopup();

		return new Promise((resolve) => {
			BX.SidePanel.Instance.open(
				url,
				{
					width: 1000,
					allowChangeHistory: false,
					cacheable: false,
				},
			);
		});
	}

	static closePopup(): void
	{
		BX.PopupWindowManager?.getPopups().forEach((popup): void => {
			popup.close();
		});
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit