core/modal_copy_to_clipboard

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:, string:|null);

Source:
License:
  • http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Methods

(async, static) create(data, title) → {Promise.<void>}

Source:

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
Name Type Description
text string

the text to copy to the clipboard

useTextArea boolean

when the text to copy is displayed in a textarea, default is input

title string | null
Returns:
Type
Promise.<void>

registerEventListeners(…args)

Source:

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>