Expand all

abstract ve.ui.MWTransclusionOutlinePartWidget

Extends

Constructor

new ve.ui.MWTransclusionOutlinePartWidget(part, config)abstract #

Common base class for top-level items (a.k.a. "parts") in the template editor sidebar. Subclasses should exist for all subclasses of {@see ve.dm.MWTransclusionPartModel}:

  • {@see ve.dm.MWTemplateModel}
  • {@see ve.dm.MWTemplatePlaceholderModel}
  • {@see ve.dm.MWTransclusionContentModel}

This is inspired by and meant to replace {@see OO.ui.DecoratedOptionWidget} in the context of the template dialog. Also see {@see OO.ui.ButtonWidget} for inspiration.

Parameters:

Name Type Description
part ve.dm.MWTransclusionPartModel
config Object
Properties:
Name Type Attributes Default Description
icon string optional
''

Symbolic name of an icon, e.g. "puzzle" or "wikiText"

label string
ariaDescriptionUnselected string
ariaDescriptionSelected string
ariaDescriptionSelectedSingle string
Source:
Common base class for top-level items (a.k.a.

Methods

isSelected() → {boolean} #

Convenience method, modelled after {@see OO.ui.OptionWidget}, but this isn't one.

Source:

Returns:

Type
boolean
Convenience method, modelled after {@see OO.ui.OptionWidget}, but this isn't one.

onHeaderKeyPressed(key)private #

setSelected(state) #

Convenience method, modelled after {@see OO.ui.OptionWidget}, but this isn't one.

Parameters:

Name Type Description
state boolean
Source:
Convenience method, modelled after {@see OO.ui.OptionWidget}, but this isn't one.

updateButtonAriaDescription(state)private #

Parameters:

Name Type Description
state boolean
Source:

Events

transclusionOutlineItemSelected(pageName, [soft]) #

Triggered when the user interacts with any sidebar element in a meaningful way, and that should be reflected in the content pane of the dialog. This includes e.g. selecting something that was already selected.

Parameters:

Name Type Attributes Description
pageName string

Unique id of the {@see OO.ui.BookletLayout} page, e.g. something like "part_1" or "part_1/param1".

soft boolean optional

If true, focus should stay in the sidebar. Defaults to false.

Source:

Triggered when the user interacts with any sidebar element in a meaningful way, and that should be reflected in the content pane of the dialog.

transclusionPartSoftSelected(partId) #

"Soft" selection with space.

Parameters:

Name Type Description
partId string

Unique id of the {@see ve.dm.MWTransclusionPartModel}, e.g. something like "part_1".

Source:
"Soft" selection with space.