Extends
Constructor
new ve.ui.MWCategoryWidget([config])abstract
#
Methods
addItems(items, [index]) → {jQuery.Promise}
#
Adds category items.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
items |
Array.<Object> | Items to add |
|
index |
number |
optional |
Index to insert items after |
Returns:
- Type
- jQuery.Promise
clearItems()
#
fitInput()
#
Auto-fit the input.
focus()
#
Focus the widget
getCategories() → {Array.<string>}
#
getCategoryItemFromValue(value) → {Object}
#
Get a category item.
Parameters:
Name | Type | Description |
---|---|---|
value |
string | Category name |
Returns:
Category item with name, value and metaItem properties
- Type
- Object
onDrag(item, newIndex)
#
Parameters:
Name | Type | Description |
---|---|---|
item |
ve.ui.MWCategoryItemWidget | Item that was moved |
newIndex |
number | The new index of the item |
onInputChoose(item)
#
Handle input 'choose' event.
Parameters:
Name | Type | Description |
---|---|---|
item |
OO.ui.MenuOptionWidget | Selected item |
onPopupClosing()
#
Handle popup closing dialog
onPopupOpened()
#
Hanle popup open event
onRemoveCategory(name)
#
Removes category from model.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Removed category name |
onTogglePopupMenu(item)
#
onUpdateSortkey(name, value)
#
Update sortkey value, emit updateSortkey event
Parameters:
Name | Type | Description |
---|---|---|
name |
string | |
value |
string |
Fires:
queryCategoryStatus(categoryNames) → {jQuery.Promise}
#
Starts a request to update the link cache's hidden and missing status for the given titles, following normalisation responses as necessary.
Parameters:
Name | Type | Description |
---|---|---|
categoryNames |
Array.<string> |
Returns:
- Type
- jQuery.Promise
Starts a request to update the link cache's hidden and missing status for the given titles, following normalisation responses as necessary.
removeItems()
#
reorder()
#
setDefaultSortKey(value)
#
Set the default sort key.
Parameters:
Name | Type | Description |
---|---|---|
value |
string | Default sort key value |
setDisabled()
#
setFragment(fragment)
#
Surface fragment for modifying meta list
Parameters:
Name | Type | Description |
---|---|---|
fragment |
ve.dm.SurfaceFragment
|
null
|
Surface fragment |
Events
newCategory(item, [beforeCategory])
#
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
item |
Object | Category item Properties:
|
|||||||||||||
beforeCategory |
ve.dm.MetaItem |
optional |
Insert after this category; if unset, insert at the end |
updateSortkey(item)
#
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
item |
Object | Category item Properties:
|