Contain the logic for the copy to clipboard modal, i.e. the modal contains a readonly input text field, that contains a value. Clicking on the single button "Copy to clipboard" in the footer, puts the content of the input text field into the clipboard and closes the modal.
Usage:
ModalCopyToClipboard.create(string:
- Source:
- Copyright:
- 2023 Stephan Robotta
- 2023 Stephan Robotta
- License:
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Methods
(async, static) create(data, title) → {Promise.<void>}
Create a new instance of the Modal. Set the text that is being copied. By default, the text is put into the value of an input readonly field. If useTextArea is set to true, the text is rendered in a textarea element. The optional title argument is for the modal title. If not set, the generic string "copy to clipboard" is used.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
data |
Object | used in the template Properties
|
|||||||||
title |
string | null |
Returns:
- Type
- Promise.<void>
registerEventListeners(…args)
Set up all the event handling for the modal. This is an override of the parent method, adding an event listener to close upon the action.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
args |
array |
<repeatable> |