Constructor
new CodeMirrorCodex()
#
- Source:
- To do:
-
- Move HTML generation to Mustache templates.
Properties
dialog :HTMLDivElement|null
#
null
#
focusedElement :HTMLElement|null
#
null
#
Methods
animateDialog(open)protected
#
Fade the dialog in or out, adjusting for scrollbar widths to prevent shifting of content. This almost fully mimics the way the Codex handles its Dialog component, with the exception that we don't force a focus trap, nor do we set aria-hidden on other elements in the DOM. This is to keep our implementation simple until something like T382532 is realized.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
open |
boolean | false |
- Source:
getButton(label, [opts]) → {HTMLButtonElement}
#
Get a CSS-only Codex Button.
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
label |
string | |||||||||||||||||||||||||||
opts |
Object |
optional |
Properties:
|
- Source:
Returns:
- Type
- HTMLButtonElement
getCheckbox(name, label, [checked]) → {Array.<HTMLElement>}
#
Get a CSS-only Codex Checkbox.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
name |
string | |||
label |
string | |||
checked |
boolean |
optional |
false |
- Source:
Returns:
[HTMLSpanElement, HTMLInputElement]
- Type
- Array.<HTMLElement>
getFieldset(legendText, …fields) → {HTMLFieldSetElement}
#
Get a CSS-only Codex fieldset with a legend.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
legendText |
string | HTMLElement | ||
fields |
Array.<HTMLElement> |
repeatable |
- Source:
Returns:
- Type
- HTMLFieldSetElement
getTextInput(name, [value], placeholder) → {Array.<HTMLElement>}
#
Get a CSS-only Codex TextInput.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
name |
string | |||
value |
string |
optional |
'' | |
placeholder |
string |
- Source:
Returns:
[HTMLDivElement, HTMLInputElement]
- Type
- Array.<HTMLElement>
getToggleButton(name, label, icon, [checked]) → {HTMLButtonElement}
#
Get a CSS-only Codex ToggleButton.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
name |
string | |||
label |
string | |||
icon |
string | |||
checked |
boolean |
optional |
false |
- Source:
Returns:
- Type
- HTMLButtonElement
showDialog(title, name, contents, [actions]) → {HTMLDivElement}
#
Show a Codex Dialog.
This implements a vanilla JS port of the Codex Dialog component. See https://w.wiki/CcWY
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
title |
string | ||
name |
string | Constructed into the CSS class |
|
contents |
HTMLElement | Array.<HTMLElement> | ||
actions |
HTMLElement | Array.<HTMLElement> |
optional |
Buttons or other actions to show in the footer. |
- Source:
Returns:
- Type
- HTMLDivElement