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/ilovecveti.ru/bitrix/js/ui/accessrights/src/item/multivariable/ |
Upload File : |
import {DefaultFooter, Dialog, Item} from 'ui.entity-selector'; import {Dom, Loc, Tag, Event} from 'main.core'; export default class Footer extends DefaultFooter { constructor(dialog: Dialog, options: { [option: string]: any }) { super(dialog, options); this.selectAllButton = Tag.render`<div class="ui-selector-footer-link ui-selector-search-footer-label--hide">${Loc.getMessage('JS_UI_ACCESSRIGHTS_ALL_SELECT_LABEL')}</div>`; Event.bind(this.selectAllButton, 'click', this.selectAll.bind(this)); this.deselectAllButton = Tag.render`<div class="ui-selector-footer-link ui-selector-search-footer-label--hide">${Loc.getMessage('JS_UI_ACCESSRIGHTS_ALL_DESELECT_LABEL')}</div>`; Event.bind(this.deselectAllButton, 'click', this.deselectAll.bind(this)); this.getDialog().subscribe('Item:onSelect', this.onItemStatusChange.bind(this)); this.getDialog().subscribe('Item:onDeselect', this.onItemStatusChange.bind(this)); } getContent(): HTMLElement { this.toggleSelectButtons(); return Tag.render` <div class="ui-selector-search-footer-box"> ${this.selectAllButton} ${this.deselectAllButton} </div> `; } toggleSelectButtons(): void { if (this.getDialog().getSelectedItems().length === this.getDialog().getItems().length) { if (Dom.hasClass(this.deselectAllButton, 'ui-selector-search-footer-label--hide')) { Dom.addClass(this.selectAllButton, 'ui-selector-search-footer-label--hide'); Dom.removeClass(this.deselectAllButton, 'ui-selector-search-footer-label--hide'); } } else if (Dom.hasClass(this.selectAllButton, 'ui-selector-search-footer-label--hide')) { Dom.addClass(this.deselectAllButton, 'ui-selector-search-footer-label--hide'); Dom.removeClass(this.selectAllButton, 'ui-selector-search-footer-label--hide'); } } selectAll(): void { if (this.getDialog().getSelectedItems().length === this.getDialog().getItems().length) { return; } this .getDialog() .getItems() .forEach((item: Item) => { item.select(); }) ; } deselectAll(): void { this .getDialog() .getSelectedItems() .forEach((item: Item) => { item.deselect(); }) ; } onItemStatusChange(): void { this.toggleSelectButtons(); } }