Documentation

BX.clipboard.bindCopyClick

void
BX.clipboard.bindCopyClick(
 DOMNode YourNode,
 Object params
);

Fuction copies text to clipboard when clicking on a certain DOM element.

Function parameters

Parameter Description
YourNode Element, when clicking on which the copying is performed
params Array of parameters. Possible 'params' object keys:
  • text - link to the object, from which the copying will be performed;
  • showButtonIfNotSupported - flag that specifies display of messages, if the clipboard copying method is not supported (by default - false);
  • popup - Popup window settings object with the information about the result of copying;

Examples of use

BX.clipboard.bindCopyClick(
    BX('copy_button'), 
    {
        text: BX('copy_text')
    }
);

Copying of the BX('copy_text') container content (text) to clipboard will occur when clicking on the BX('copy_button') element (container can be a form input element as well).



© «Bitrix24», 2001-2024