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:
|
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 |
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.
focusPart(pageName)
#
Parameters:
Name | Type | Description |
---|---|---|
pageName |
string |
getCurrentPage() → {OO.ui.PageLayout|undefined
}
#
undefined
}
#
getOutlineControls() → {ve.ui.MWTransclusionOutlineControlsWidget}
#
getPage(name) → {OO.ui.PageLayout|undefined
}
#
undefined
}
#
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Symbolic name of page |
Returns:
Page, if found
- Type
-
OO.ui.PageLayout
|
undefined
getPagesOrdered() → {Array.<OO.ui.PageLayout>}
#
getSelectedTopLevelPartId() → {string|null
}
#
null
}
#
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
}
#
null
}
#
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> |
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 |
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. |
onStackLayoutFocus(e)private
#
Parameters:
Name | Type | Description |
---|---|---|
e |
jQuery.Event | Focusin event |
refreshControls()private
#
removePages(pagesNamesToRemove)
#
Parameters:
Name | Type | Description |
---|---|---|
pagesNamesToRemove |
Array.<string> |
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. |
toggleOutline(show)
#
Parameters:
Name | Type | Description |
---|---|---|
show |
boolean | If the sidebar should be shown or not. |