Extends
Constructor
new ve.ui.LinearContext(surface, [config])abstract
#
Hierarchy
Children
UserInterface context.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
surface |
ve.ui.Surface | ||
config |
Object |
optional |
Configuration options |
Properties
createInspectorWindowManagerabstract
#
Create a inspector window manager.
getRelatedSources
#
Get related item sources.
Result is cached, and cleared when the model or selection changes.
- Overrides:
- Source:
Methods
addPersistentSource(source)
#
Add a persistent source that will stay visible until manually removed.
Parameters:
Name | Type | Description |
---|---|---|
source |
Object | Object containing |
afterContextChange()
#
Handle debounced context change events.
destroy() → {ve.ui.Context}chainable
#
getInspectors() → {ve.ui.WindowManager}
#
getRelatedSourcesFromModels(selectedModels) → {Array.<Object>}
#
Get related for selected models
Parameters:
Name | Type | Description |
---|---|---|
selectedModels |
Array.<ve.dm.Model> | Models |
Returns:
See #getRelatedSources
getSurface() → {ve.ui.Surface}
#
getSurfacePadding() → {ve.ui.Surface.Padding|null
}
#
null
}
#
Get an object describing the amount of padding the context adds to the surface.
For example the mobile context, which is fixed to the bottom of the viewport, will add bottom padding, whereas the floating desktop context will add none.
- Inherited from:
- Source:
Returns:
Padding object, or null
- Type
-
ve.ui.Surface.Padding
|
null
hide()
#
Hide the context while it has valid items in the menu
This could be triggered by clicking the close button on mobile or by pressing escape.
- Inherited from:
- Source:
Hide the context while it has valid items in the menu
This could be triggered by clicking the close button on mobile or by pressing escape.
isInspectable() → {boolean}
#
Check if current content is inspectable.
Returns:
Content is inspectable
- Type
- boolean
isMobile() → {boolean}
#
Check if context is for mobile devices
- Inherited from:
- Source:
Returns:
Context is for mobile devices
- Type
- boolean
isVisible() → {boolean}
#
Check if context is visible.
- Overrides:
- Source:
Returns:
Context is visible
- Type
- boolean
onContextChange()
#
Handle context change event.
While an inspector is opening or closing, all changes are ignored so as to prevent inspectors that change the selection from within their setup or teardown processes changing context state.
The response to selection changes is deferred to prevent teardown processes handlers that change the selection from causing this function to recurse. These responses are also debounced for efficiency, so that if there are three selection changes in the same tick, #afterContextChange only runs once.
- Source:
- See:
onContextItemCommand()
#
Handle command events from context items
- Inherited from:
- Source:
onDocumentUpdate()
#
Handle document update event.
onInspectorOpening(win, opening, data)
#
Handle an inspector opening event.
Parameters:
Name | Type | Description |
---|---|---|
win |
OO.ui.Window | Window that's being opened |
opening |
jQuery.Promise | Promise resolved when window is opened; when the promise is resolved the first argument will be a promise which will be resolved when the window begins closing, the second argument will be the opening data |
data |
Object | Window opening data |
removePersistentSource(name)
#
Remove a persistent source by name
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Source name |
setupMenuItems([previousItems]) → {ve.ui.Context}protectedchainable
#
Setup menu items.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
previousItems |
Array.<ve.ui.ContextItem> |
optional |
if a context is being refreshed, this will be the previously-open items for comparison |
- Inherited from:
- Source:
Returns:
- Type
- ve.ui.Context
teardownMenuItems() → {ve.ui.Context}protectedchainable
#
toggle([show]) → {jQuery.Promise}
#
Toggle the visibility of the context.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
show |
boolean |
optional |
Show the context, omit to toggle |
- Inherited from:
- Source:
Returns:
Promise resolved when context is finished showing/hiding
- Type
- jQuery.Promise
Fires:
toggleMenu([show]) → {ve.ui.Context}chainable
#
Toggle the menu.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
show |
boolean |
optional |
Show the menu, omit to toggle |
- Inherited from:
- Source:
Returns:
- Type
- ve.ui.Context
updateDimensions() → {ve.ui.Context}chainable
#
Update the size and position of the context.
- Inherited from:
- Source:
Returns:
- Type
- ve.ui.Context
Fires:
Events
resize()
#
- Inherited from:
- Source: