Expand all

ve.ui.MWTwoPaneTransclusionDialogLayout

Extends

Constructor

new ve.ui.MWTwoPaneTransclusionDialogLayout([config]) #

Specialized layout forked from and similar to {@see OO.ui.BookletLayout}, but to synchronize the sidebar and content pane of the transclusion dialog.

Also owns the outline controls.

This class has domain knowledge about its contents, for example different behaviors for template vs template parameter elements.

Parameters:

Name Type Attributes Description
config Object optional

Configuration options

Properties:

Name Type Description
pages Object.<string, OO.ui.PageLayout>
currentPageName string

Name of the currently selected transclusion item (top-level part or template parameter). Typically represented as a blue bar in the sidebar. Special cases you should be aware of:

  • An unchecked parameter exists as an item in the sidebar, but not as a page in the content pane.
  • A parameter placeholder (to add an undocumented parameter) exists as a page in the content pane, but has no corresponding item in the sidebar.
Source:

Specialized layout forked from and similar to {@see OO.ui.BookletLayout}, but to synchronize the sidebar and content pane of the transclusion dialog.

Methods

addPages(pages, index) #

When pages are added with the same names as existing pages, the existing pages will be automatically removed before the new pages are added.

Parameters:

Name Type Description
pages Array.<OO.ui.PageLayout>

Pages to add

index number

Index of the insertion point

Source:

When pages are added with the same names as existing pages, the existing pages will be automatically removed before the new pages are added.

focus() #

Focus the input field for the current page.

If the focus is already in an element on the current page, nothing will happen.

Source:
Focus the input field for the current page.

focusPart(pageName) #

Parameters:

Name Type Description
pageName string
Source:

getCurrentPage() → {OO.ui.PageLayout|undefined} #

Source:

Returns:

Current page, if found

Type
OO.ui.PageLayout | undefined

getPage(name) → {OO.ui.PageLayout|undefined} #

Parameters:

Name Type Description
name string

Symbolic name of page

Source:

Returns:

Page, if found

Type
OO.ui.PageLayout | undefined

getPagesOrdered() → {Array.<OO.ui.PageLayout>} #

Get the list of pages on the stack ordered by appearance.

Source:

Returns:

Type
Array.<OO.ui.PageLayout>
Get the list of pages on the stack ordered by appearance.

getSelectedTopLevelPartId() → {string|null} #

Source:

Returns:

A top-level part id like "part_0" if that part is selected. When a parameter is selected null is returned.

Type
string | null

getTopLevelPartIdForSelection() → {string|null} #

Source:

Returns:

A top-level part id like "part_0" that corresponds to the current selection, whatever is selected. When a parameter is selected the id of the template the parameter belongs to is returned.

Type
string | null

onFilterPagesByName(visibility)private #

Parameters:

Name Type Description
visibility Object.<string, boolean>
Source:

onReplacePart(removed, added, [newPosition]) #

Parameters:

Name Type Attributes Description
removed ve.dm.MWTransclusionPartModel | null

Removed part

added ve.dm.MWTransclusionPartModel | null

Added part

newPosition number optional
Source:

onSidebarItemSelected(pageName, [soft]) #

Parts and parameters can be soft-selected, or selected and focused.

Parameters:

Name Type Attributes Description
pageName string | null

Full, unique name of part or parameter, or null to deselect

soft boolean optional

If true, suppress content pane focus.

Source:
Parts and parameters can be soft-selected, or selected and focused.

onStackLayoutFocus(e)private #

Parameters:

Name Type Description
e jQuery.Event

Focusin event

Source:

removePages(pagesNamesToRemove) #

Parameters:

Name Type Description
pagesNamesToRemove Array.<string>
Source:

setPage([name]) #

Set the current page and sidebar selection, by symbolic name. Doesn't focus the input.

Parameters:

Name Type Attributes Description
name string optional

Symbolic name of page. Omit to remove current selection.

Source:
Set the current page and sidebar selection, by symbolic name.

toggleOutline(show) #

Parameters:

Name Type Description
show boolean

If the sidebar should be shown or not.

Source: